
kernel:     file format elf32-i386


Disassembly of section .text:

80100000 <multiboot_header>:
80100000:	02 b0 ad 1b 00 00    	add    0x1bad(%eax),%dh
80100006:	00 00                	add    %al,(%eax)
80100008:	fe 4f 52             	decb   0x52(%edi)
8010000b:	e4                   	.byte 0xe4

8010000c <entry>:

# Entering xv6 on boot processor, with paging off.
.globl entry
entry:
  # Turn on page size extension for 4Mbyte pages
  movl    %cr4, %eax
8010000c:	0f 20 e0             	mov    %cr4,%eax
  orl     $(CR4_PSE), %eax
8010000f:	83 c8 10             	or     $0x10,%eax
  movl    %eax, %cr4
80100012:	0f 22 e0             	mov    %eax,%cr4
  # Set page directory
  movl    $(V2P_WO(entrypgdir)), %eax
80100015:	b8 00 80 10 00       	mov    $0x108000,%eax
  movl    %eax, %cr3
8010001a:	0f 22 d8             	mov    %eax,%cr3
  # Turn on paging.
  movl    %cr0, %eax
8010001d:	0f 20 c0             	mov    %cr0,%eax
  orl     $(CR0_PG|CR0_WP), %eax
80100020:	0d 00 00 01 80       	or     $0x80010000,%eax
  movl    %eax, %cr0
80100025:	0f 22 c0             	mov    %eax,%cr0

  # Set up the stack pointer.
  movl $(stack + KSTACKSIZE), %esp
80100028:	bc e0 a8 10 80       	mov    $0x8010a8e0,%esp

  # Jump to main(), and switch to executing at
  # high addresses. The indirect call is needed because
  # the assembler produces a PC-relative instruction
  # for a direct jump.
  mov $main, %eax
8010002d:	b8 a0 00 10 80       	mov    $0x801000a0,%eax
  jmp *%eax
80100032:	ff e0                	jmp    *%eax
80100034:	66 90                	xchg   %ax,%ax
80100036:	66 90                	xchg   %ax,%ax
80100038:	66 90                	xchg   %ax,%ax
8010003a:	66 90                	xchg   %ax,%ax
8010003c:	66 90                	xchg   %ax,%ax
8010003e:	66 90                	xchg   %ax,%ax

80100040 <mpmain>:
}

// Common CPU setup code.
static void
mpmain(void)
{
80100040:	55                   	push   %ebp
80100041:	89 e5                	mov    %esp,%ebp
80100043:	53                   	push   %ebx
80100044:	83 ec 04             	sub    $0x4,%esp
  cprintf("cpu%d: starting %d\n", cpuid(), cpuid());
80100047:	e8 d4 38 00 00       	call   80103920 <cpuid>
8010004c:	89 c3                	mov    %eax,%ebx
8010004e:	e8 cd 38 00 00       	call   80103920 <cpuid>
80100053:	83 ec 04             	sub    $0x4,%esp
80100056:	53                   	push   %ebx
80100057:	50                   	push   %eax
80100058:	68 40 72 10 80       	push   $0x80107240
8010005d:	e8 7e 1c 00 00       	call   80101ce0 <cprintf>
  idtinit();       // load idt register
80100062:	e8 c9 64 00 00       	call   80106530 <idtinit>
  xchg(&(mycpu()->started), 1); // tell startothers() we're up
80100067:	e8 44 38 00 00       	call   801038b0 <mycpu>
8010006c:	89 c2                	mov    %eax,%edx
xchg(volatile uint *addr, uint newval)
{
  uint result;

  // The + in "+m" denotes a read-modify-write operand.
  asm volatile("lock; xchgl %0, %1" :
8010006e:	b8 01 00 00 00       	mov    $0x1,%eax
80100073:	f0 87 82 a0 00 00 00 	lock xchg %eax,0xa0(%edx)
  scheduler();     // start running processes
8010007a:	e8 91 3b 00 00       	call   80103c10 <scheduler>
8010007f:	90                   	nop

80100080 <mpenter>:
{
80100080:	f3 0f 1e fb          	endbr32 
80100084:	55                   	push   %ebp
80100085:	89 e5                	mov    %esp,%ebp
80100087:	83 ec 08             	sub    $0x8,%esp
  switchkvm();
8010008a:	e8 21 48 00 00       	call   801048b0 <switchkvm>
  seginit();
8010008f:	e8 8c 47 00 00       	call   80104820 <seginit>
  lapicinit();
80100094:	e8 17 06 00 00       	call   801006b0 <lapicinit>
  mpmain();
80100099:	e8 a2 ff ff ff       	call   80100040 <mpmain>
8010009e:	66 90                	xchg   %ax,%ax

801000a0 <main>:
{
801000a0:	f3 0f 1e fb          	endbr32 
801000a4:	8d 4c 24 04          	lea    0x4(%esp),%ecx
801000a8:	83 e4 f0             	and    $0xfffffff0,%esp
801000ab:	ff 71 fc             	pushl  -0x4(%ecx)
801000ae:	55                   	push   %ebp
801000af:	89 e5                	mov    %esp,%ebp
801000b1:	53                   	push   %ebx
801000b2:	51                   	push   %ecx
  kinit1(end, P2V(4*1024*1024)); // phys page allocator
801000b3:	83 ec 08             	sub    $0x8,%esp
801000b6:	68 00 00 40 80       	push   $0x80400000
801000bb:	68 e4 49 11 80       	push   $0x801149e4
801000c0:	e8 cb 4f 00 00       	call   80105090 <kinit1>
  kvmalloc();      // kernel page table
801000c5:	e8 c6 4c 00 00       	call   80104d90 <kvmalloc>
  mpinit();        // detect other processors
801000ca:	e8 51 0a 00 00       	call   80100b20 <mpinit>
  lapicinit();     // interrupt controller
801000cf:	e8 dc 05 00 00       	call   801006b0 <lapicinit>
  seginit();       // segment descriptors
801000d4:	e8 47 47 00 00       	call   80104820 <seginit>
  picinit();       // disable pic
801000d9:	e8 c2 04 00 00       	call   801005a0 <picinit>
  ioapicinit();    // another interrupt controller
801000de:	e8 dd 04 00 00       	call   801005c0 <ioapicinit>
  consoleinit();   // console hardware
801000e3:	e8 78 1f 00 00       	call   80102060 <consoleinit>
  uartinit();      // serial port
801000e8:	e8 43 21 00 00       	call   80102230 <uartinit>
  pinit();         // process table
801000ed:	e8 9e 37 00 00       	call   80103890 <pinit>
  tvinit();        // trap vectors
801000f2:	e8 b9 63 00 00       	call   801064b0 <tvinit>
  binit();         // buffer cache
801000f7:	e8 04 31 00 00       	call   80103200 <binit>
  fileinit();      // file table
801000fc:	e8 4f 10 00 00       	call   80101150 <fileinit>
  ideinit();       // disk 
80100101:	e8 2a 34 00 00       	call   80103530 <ideinit>

  // Write entry code to unused memory at 0x7000.
  // The linker has placed the image of entryother.S in
  // _binary_entryother_start.
  code = P2V(0x7000);
  memmove(code, _binary_entryother_start, (uint)_binary_entryother_size);
80100106:	83 c4 0c             	add    $0xc,%esp
80100109:	68 8a 00 00 00       	push   $0x8a
8010010e:	68 8c 97 10 80       	push   $0x8010978c
80100113:	68 00 70 00 80       	push   $0x80007000
80100118:	e8 53 51 00 00       	call   80105270 <memmove>

  for(c = cpus; c < cpus+ncpu; c++){
8010011d:	83 c4 10             	add    $0x10,%esp
80100120:	69 05 a0 ae 10 80 b0 	imul   $0xb0,0x8010aea0,%eax
80100127:	00 00 00 
8010012a:	05 20 a9 10 80       	add    $0x8010a920,%eax
8010012f:	3d 20 a9 10 80       	cmp    $0x8010a920,%eax
80100134:	76 7a                	jbe    801001b0 <main+0x110>
80100136:	bb 20 a9 10 80       	mov    $0x8010a920,%ebx
8010013b:	eb 1c                	jmp    80100159 <main+0xb9>
8010013d:	8d 76 00             	lea    0x0(%esi),%esi
80100140:	69 05 a0 ae 10 80 b0 	imul   $0xb0,0x8010aea0,%eax
80100147:	00 00 00 
8010014a:	81 c3 b0 00 00 00    	add    $0xb0,%ebx
80100150:	05 20 a9 10 80       	add    $0x8010a920,%eax
80100155:	39 c3                	cmp    %eax,%ebx
80100157:	73 57                	jae    801001b0 <main+0x110>
    if(c == mycpu())  // We've started already.
80100159:	e8 52 37 00 00       	call   801038b0 <mycpu>
8010015e:	39 c3                	cmp    %eax,%ebx
80100160:	74 de                	je     80100140 <main+0xa0>
      continue;

    // Tell entryother.S what stack to use, where to enter, and what
    // pgdir to use. We cannot use kpgdir yet, because the AP processor
    // is running in low  memory, so we use entrypgdir for the APs too.
    stack = kalloc();
80100162:	e8 f9 4f 00 00       	call   80105160 <kalloc>
    *(void**)(code-4) = stack + KSTACKSIZE;
    *(void(**)(void))(code-8) = mpenter;
    *(int**)(code-12) = (void *) V2P(entrypgdir);

    lapicstartap(c->apicid, V2P(code));
80100167:	83 ec 08             	sub    $0x8,%esp
    *(void(**)(void))(code-8) = mpenter;
8010016a:	c7 05 f8 6f 00 80 80 	movl   $0x80100080,0x80006ff8
80100171:	00 10 80 
    *(int**)(code-12) = (void *) V2P(entrypgdir);
80100174:	c7 05 f4 6f 00 80 00 	movl   $0x108000,0x80006ff4
8010017b:	80 10 00 
    *(void**)(code-4) = stack + KSTACKSIZE;
8010017e:	05 00 10 00 00       	add    $0x1000,%eax
80100183:	a3 fc 6f 00 80       	mov    %eax,0x80006ffc
    lapicstartap(c->apicid, V2P(code));
80100188:	0f b6 03             	movzbl (%ebx),%eax
8010018b:	68 00 70 00 00       	push   $0x7000
80100190:	50                   	push   %eax
80100191:	e8 6a 06 00 00       	call   80100800 <lapicstartap>

    // wait for cpu to finish mpmain()
    while(c->started == 0)
80100196:	83 c4 10             	add    $0x10,%esp
80100199:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801001a0:	8b 83 a0 00 00 00    	mov    0xa0(%ebx),%eax
801001a6:	85 c0                	test   %eax,%eax
801001a8:	74 f6                	je     801001a0 <main+0x100>
801001aa:	eb 94                	jmp    80100140 <main+0xa0>
801001ac:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
801001b0:	83 ec 08             	sub    $0x8,%esp
801001b3:	68 00 00 00 8e       	push   $0x8e000000
801001b8:	68 00 00 40 80       	push   $0x80400000
801001bd:	e8 3e 4f 00 00       	call   80105100 <kinit2>
  userinit();      // first user process
801001c2:	e8 a9 37 00 00       	call   80103970 <userinit>
  mpmain();        // finish this processor's setup
801001c7:	e8 74 fe ff ff       	call   80100040 <mpmain>
801001cc:	66 90                	xchg   %ax,%ax
801001ce:	66 90                	xchg   %ax,%ax

801001d0 <initsleeplock>:
#include "spinlock.h"
#include "sleeplock.h"

void
initsleeplock(struct sleeplock *lk, char *name)
{
801001d0:	f3 0f 1e fb          	endbr32 
801001d4:	55                   	push   %ebp
801001d5:	89 e5                	mov    %esp,%ebp
801001d7:	53                   	push   %ebx
801001d8:	83 ec 0c             	sub    $0xc,%esp
801001db:	8b 5d 08             	mov    0x8(%ebp),%ebx
  initlock(&lk->lk, "sleep lock");
801001de:	68 54 72 10 80       	push   $0x80107254
801001e3:	8d 43 04             	lea    0x4(%ebx),%eax
801001e6:	50                   	push   %eax
801001e7:	e8 24 01 00 00       	call   80100310 <initlock>
  lk->name = name;
801001ec:	8b 45 0c             	mov    0xc(%ebp),%eax
  lk->locked = 0;
801001ef:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  lk->pid = 0;
}
801001f5:	83 c4 10             	add    $0x10,%esp
  lk->pid = 0;
801001f8:	c7 43 3c 00 00 00 00 	movl   $0x0,0x3c(%ebx)
  lk->name = name;
801001ff:	89 43 38             	mov    %eax,0x38(%ebx)
}
80100202:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80100205:	c9                   	leave  
80100206:	c3                   	ret    
80100207:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010020e:	66 90                	xchg   %ax,%ax

80100210 <acquiresleep>:

void
acquiresleep(struct sleeplock *lk)
{
80100210:	f3 0f 1e fb          	endbr32 
80100214:	55                   	push   %ebp
80100215:	89 e5                	mov    %esp,%ebp
80100217:	56                   	push   %esi
80100218:	53                   	push   %ebx
80100219:	8b 5d 08             	mov    0x8(%ebp),%ebx
  acquire(&lk->lk);
8010021c:	8d 73 04             	lea    0x4(%ebx),%esi
8010021f:	83 ec 0c             	sub    $0xc,%esp
80100222:	56                   	push   %esi
80100223:	e8 68 02 00 00       	call   80100490 <acquire>
  while (lk->locked) {
80100228:	8b 13                	mov    (%ebx),%edx
8010022a:	83 c4 10             	add    $0x10,%esp
8010022d:	85 d2                	test   %edx,%edx
8010022f:	74 1a                	je     8010024b <acquiresleep+0x3b>
80100231:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    sleep(lk, &lk->lk);
80100238:	83 ec 08             	sub    $0x8,%esp
8010023b:	56                   	push   %esi
8010023c:	53                   	push   %ebx
8010023d:	e8 1e 3d 00 00       	call   80103f60 <sleep>
  while (lk->locked) {
80100242:	8b 03                	mov    (%ebx),%eax
80100244:	83 c4 10             	add    $0x10,%esp
80100247:	85 c0                	test   %eax,%eax
80100249:	75 ed                	jne    80100238 <acquiresleep+0x28>
  }
  lk->locked = 1;
8010024b:	c7 03 01 00 00 00    	movl   $0x1,(%ebx)
  lk->pid = myproc()->pid;
80100251:	e8 ea 36 00 00       	call   80103940 <myproc>
80100256:	8b 40 10             	mov    0x10(%eax),%eax
80100259:	89 43 3c             	mov    %eax,0x3c(%ebx)
  release(&lk->lk);
8010025c:	89 75 08             	mov    %esi,0x8(%ebp)
}
8010025f:	8d 65 f8             	lea    -0x8(%ebp),%esp
80100262:	5b                   	pop    %ebx
80100263:	5e                   	pop    %esi
80100264:	5d                   	pop    %ebp
  release(&lk->lk);
80100265:	e9 e6 02 00 00       	jmp    80100550 <release>
8010026a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80100270 <releasesleep>:

void
releasesleep(struct sleeplock *lk)
{
80100270:	f3 0f 1e fb          	endbr32 
80100274:	55                   	push   %ebp
80100275:	89 e5                	mov    %esp,%ebp
80100277:	56                   	push   %esi
80100278:	53                   	push   %ebx
80100279:	8b 5d 08             	mov    0x8(%ebp),%ebx
  acquire(&lk->lk);
8010027c:	8d 73 04             	lea    0x4(%ebx),%esi
8010027f:	83 ec 0c             	sub    $0xc,%esp
80100282:	56                   	push   %esi
80100283:	e8 08 02 00 00       	call   80100490 <acquire>
  lk->locked = 0;
80100288:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  lk->pid = 0;
8010028e:	c7 43 3c 00 00 00 00 	movl   $0x0,0x3c(%ebx)
  wakeup(lk);
80100295:	89 1c 24             	mov    %ebx,(%esp)
80100298:	e8 83 3e 00 00       	call   80104120 <wakeup>
  release(&lk->lk);
8010029d:	89 75 08             	mov    %esi,0x8(%ebp)
801002a0:	83 c4 10             	add    $0x10,%esp
}
801002a3:	8d 65 f8             	lea    -0x8(%ebp),%esp
801002a6:	5b                   	pop    %ebx
801002a7:	5e                   	pop    %esi
801002a8:	5d                   	pop    %ebp
  release(&lk->lk);
801002a9:	e9 a2 02 00 00       	jmp    80100550 <release>
801002ae:	66 90                	xchg   %ax,%ax

801002b0 <holdingsleep>:

int
holdingsleep(struct sleeplock *lk)
{
801002b0:	f3 0f 1e fb          	endbr32 
801002b4:	55                   	push   %ebp
801002b5:	89 e5                	mov    %esp,%ebp
801002b7:	57                   	push   %edi
801002b8:	31 ff                	xor    %edi,%edi
801002ba:	56                   	push   %esi
801002bb:	53                   	push   %ebx
801002bc:	83 ec 18             	sub    $0x18,%esp
801002bf:	8b 5d 08             	mov    0x8(%ebp),%ebx
  int r;
  
  acquire(&lk->lk);
801002c2:	8d 73 04             	lea    0x4(%ebx),%esi
801002c5:	56                   	push   %esi
801002c6:	e8 c5 01 00 00       	call   80100490 <acquire>
  r = lk->locked && (lk->pid == myproc()->pid);
801002cb:	8b 03                	mov    (%ebx),%eax
801002cd:	83 c4 10             	add    $0x10,%esp
801002d0:	85 c0                	test   %eax,%eax
801002d2:	75 1c                	jne    801002f0 <holdingsleep+0x40>
  release(&lk->lk);
801002d4:	83 ec 0c             	sub    $0xc,%esp
801002d7:	56                   	push   %esi
801002d8:	e8 73 02 00 00       	call   80100550 <release>
  return r;
}
801002dd:	8d 65 f4             	lea    -0xc(%ebp),%esp
801002e0:	89 f8                	mov    %edi,%eax
801002e2:	5b                   	pop    %ebx
801002e3:	5e                   	pop    %esi
801002e4:	5f                   	pop    %edi
801002e5:	5d                   	pop    %ebp
801002e6:	c3                   	ret    
801002e7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801002ee:	66 90                	xchg   %ax,%ax
  r = lk->locked && (lk->pid == myproc()->pid);
801002f0:	8b 5b 3c             	mov    0x3c(%ebx),%ebx
801002f3:	e8 48 36 00 00       	call   80103940 <myproc>
801002f8:	39 58 10             	cmp    %ebx,0x10(%eax)
801002fb:	0f 94 c0             	sete   %al
801002fe:	0f b6 c0             	movzbl %al,%eax
80100301:	89 c7                	mov    %eax,%edi
80100303:	eb cf                	jmp    801002d4 <holdingsleep+0x24>
80100305:	66 90                	xchg   %ax,%ax
80100307:	66 90                	xchg   %ax,%ax
80100309:	66 90                	xchg   %ax,%ax
8010030b:	66 90                	xchg   %ax,%ax
8010030d:	66 90                	xchg   %ax,%ax
8010030f:	90                   	nop

80100310 <initlock>:
#include "proc.h"
#include "spinlock.h"

void
initlock(struct spinlock *lk, char *name)
{
80100310:	f3 0f 1e fb          	endbr32 
80100314:	55                   	push   %ebp
80100315:	89 e5                	mov    %esp,%ebp
80100317:	8b 45 08             	mov    0x8(%ebp),%eax
  lk->name = name;
8010031a:	8b 55 0c             	mov    0xc(%ebp),%edx
  lk->locked = 0;
8010031d:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
  lk->name = name;
80100323:	89 50 04             	mov    %edx,0x4(%eax)
  lk->cpu = 0;
80100326:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
}
8010032d:	5d                   	pop    %ebp
8010032e:	c3                   	ret    
8010032f:	90                   	nop

80100330 <getcallerpcs>:
}

// Record the current call stack in pcs[] by following the %ebp chain.
void
getcallerpcs(void *v, uint pcs[])
{
80100330:	f3 0f 1e fb          	endbr32 
80100334:	55                   	push   %ebp
  uint *ebp;
  int i;

  ebp = (uint*)v - 2;
  for(i = 0; i < 10; i++){
80100335:	31 d2                	xor    %edx,%edx
{
80100337:	89 e5                	mov    %esp,%ebp
80100339:	53                   	push   %ebx
  ebp = (uint*)v - 2;
8010033a:	8b 45 08             	mov    0x8(%ebp),%eax
{
8010033d:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  ebp = (uint*)v - 2;
80100340:	83 e8 08             	sub    $0x8,%eax
  for(i = 0; i < 10; i++){
80100343:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80100347:	90                   	nop
    if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
80100348:	8d 98 00 00 00 80    	lea    -0x80000000(%eax),%ebx
8010034e:	81 fb fe ff ff 7f    	cmp    $0x7ffffffe,%ebx
80100354:	77 1a                	ja     80100370 <getcallerpcs+0x40>
      break;
    pcs[i] = ebp[1];     // saved %eip
80100356:	8b 58 04             	mov    0x4(%eax),%ebx
80100359:	89 1c 91             	mov    %ebx,(%ecx,%edx,4)
  for(i = 0; i < 10; i++){
8010035c:	83 c2 01             	add    $0x1,%edx
    ebp = (uint*)ebp[0]; // saved %ebp
8010035f:	8b 00                	mov    (%eax),%eax
  for(i = 0; i < 10; i++){
80100361:	83 fa 0a             	cmp    $0xa,%edx
80100364:	75 e2                	jne    80100348 <getcallerpcs+0x18>
  }
  for(; i < 10; i++)
    pcs[i] = 0;
}
80100366:	5b                   	pop    %ebx
80100367:	5d                   	pop    %ebp
80100368:	c3                   	ret    
80100369:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  for(; i < 10; i++)
80100370:	8d 04 91             	lea    (%ecx,%edx,4),%eax
80100373:	8d 51 28             	lea    0x28(%ecx),%edx
80100376:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010037d:	8d 76 00             	lea    0x0(%esi),%esi
    pcs[i] = 0;
80100380:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
  for(; i < 10; i++)
80100386:	83 c0 04             	add    $0x4,%eax
80100389:	39 d0                	cmp    %edx,%eax
8010038b:	75 f3                	jne    80100380 <getcallerpcs+0x50>
}
8010038d:	5b                   	pop    %ebx
8010038e:	5d                   	pop    %ebp
8010038f:	c3                   	ret    

80100390 <pushcli>:
// it takes two popcli to undo two pushcli.  Also, if interrupts
// are off, then pushcli, popcli leaves them off.

void
pushcli(void)
{
80100390:	f3 0f 1e fb          	endbr32 
80100394:	55                   	push   %ebp
80100395:	89 e5                	mov    %esp,%ebp
80100397:	53                   	push   %ebx
80100398:	83 ec 04             	sub    $0x4,%esp
  asm volatile("pushfl; popl %0" : "=r" (eflags));
8010039b:	9c                   	pushf  
8010039c:	5b                   	pop    %ebx
  asm volatile("cli");
8010039d:	fa                   	cli    
  int eflags;

  eflags = readeflags();
  cli();
  if(mycpu()->ncli == 0)
8010039e:	e8 0d 35 00 00       	call   801038b0 <mycpu>
801003a3:	8b 80 a4 00 00 00    	mov    0xa4(%eax),%eax
801003a9:	85 c0                	test   %eax,%eax
801003ab:	74 13                	je     801003c0 <pushcli+0x30>
    mycpu()->intena = eflags & FL_IF;
  mycpu()->ncli += 1;
801003ad:	e8 fe 34 00 00       	call   801038b0 <mycpu>
801003b2:	83 80 a4 00 00 00 01 	addl   $0x1,0xa4(%eax)
}
801003b9:	83 c4 04             	add    $0x4,%esp
801003bc:	5b                   	pop    %ebx
801003bd:	5d                   	pop    %ebp
801003be:	c3                   	ret    
801003bf:	90                   	nop
    mycpu()->intena = eflags & FL_IF;
801003c0:	e8 eb 34 00 00       	call   801038b0 <mycpu>
801003c5:	81 e3 00 02 00 00    	and    $0x200,%ebx
801003cb:	89 98 a8 00 00 00    	mov    %ebx,0xa8(%eax)
801003d1:	eb da                	jmp    801003ad <pushcli+0x1d>
801003d3:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801003da:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801003e0 <popcli>:

void
popcli(void)
{
801003e0:	f3 0f 1e fb          	endbr32 
801003e4:	55                   	push   %ebp
801003e5:	89 e5                	mov    %esp,%ebp
801003e7:	83 ec 08             	sub    $0x8,%esp
  asm volatile("pushfl; popl %0" : "=r" (eflags));
801003ea:	9c                   	pushf  
801003eb:	58                   	pop    %eax
  if(readeflags()&FL_IF)
801003ec:	f6 c4 02             	test   $0x2,%ah
801003ef:	75 31                	jne    80100422 <popcli+0x42>
    panic("popcli - interruptible");
  if(--mycpu()->ncli < 0)
801003f1:	e8 ba 34 00 00       	call   801038b0 <mycpu>
801003f6:	83 a8 a4 00 00 00 01 	subl   $0x1,0xa4(%eax)
801003fd:	78 30                	js     8010042f <popcli+0x4f>
    panic("popcli");
  if(mycpu()->ncli == 0 && mycpu()->intena)
801003ff:	e8 ac 34 00 00       	call   801038b0 <mycpu>
80100404:	8b 90 a4 00 00 00    	mov    0xa4(%eax),%edx
8010040a:	85 d2                	test   %edx,%edx
8010040c:	74 02                	je     80100410 <popcli+0x30>
    sti();
}
8010040e:	c9                   	leave  
8010040f:	c3                   	ret    
  if(mycpu()->ncli == 0 && mycpu()->intena)
80100410:	e8 9b 34 00 00       	call   801038b0 <mycpu>
80100415:	8b 80 a8 00 00 00    	mov    0xa8(%eax),%eax
8010041b:	85 c0                	test   %eax,%eax
8010041d:	74 ef                	je     8010040e <popcli+0x2e>
  asm volatile("sti");
8010041f:	fb                   	sti    
}
80100420:	c9                   	leave  
80100421:	c3                   	ret    
    panic("popcli - interruptible");
80100422:	83 ec 0c             	sub    $0xc,%esp
80100425:	68 5f 72 10 80       	push   $0x8010725f
8010042a:	e8 91 15 00 00       	call   801019c0 <panic>
    panic("popcli");
8010042f:	83 ec 0c             	sub    $0xc,%esp
80100432:	68 76 72 10 80       	push   $0x80107276
80100437:	e8 84 15 00 00       	call   801019c0 <panic>
8010043c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80100440 <holding>:
{
80100440:	f3 0f 1e fb          	endbr32 
80100444:	55                   	push   %ebp
80100445:	89 e5                	mov    %esp,%ebp
80100447:	56                   	push   %esi
80100448:	53                   	push   %ebx
80100449:	8b 75 08             	mov    0x8(%ebp),%esi
8010044c:	31 db                	xor    %ebx,%ebx
  pushcli();
8010044e:	e8 3d ff ff ff       	call   80100390 <pushcli>
  r = lock->locked && lock->cpu == mycpu();
80100453:	8b 06                	mov    (%esi),%eax
80100455:	85 c0                	test   %eax,%eax
80100457:	75 0f                	jne    80100468 <holding+0x28>
  popcli();
80100459:	e8 82 ff ff ff       	call   801003e0 <popcli>
}
8010045e:	89 d8                	mov    %ebx,%eax
80100460:	5b                   	pop    %ebx
80100461:	5e                   	pop    %esi
80100462:	5d                   	pop    %ebp
80100463:	c3                   	ret    
80100464:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  r = lock->locked && lock->cpu == mycpu();
80100468:	8b 5e 08             	mov    0x8(%esi),%ebx
8010046b:	e8 40 34 00 00       	call   801038b0 <mycpu>
80100470:	39 c3                	cmp    %eax,%ebx
80100472:	0f 94 c3             	sete   %bl
  popcli();
80100475:	e8 66 ff ff ff       	call   801003e0 <popcli>
  r = lock->locked && lock->cpu == mycpu();
8010047a:	0f b6 db             	movzbl %bl,%ebx
}
8010047d:	89 d8                	mov    %ebx,%eax
8010047f:	5b                   	pop    %ebx
80100480:	5e                   	pop    %esi
80100481:	5d                   	pop    %ebp
80100482:	c3                   	ret    
80100483:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010048a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80100490 <acquire>:
{
80100490:	f3 0f 1e fb          	endbr32 
80100494:	55                   	push   %ebp
80100495:	89 e5                	mov    %esp,%ebp
80100497:	56                   	push   %esi
80100498:	53                   	push   %ebx
  pushcli(); // disable interrupts to avoid deadlock.
80100499:	e8 f2 fe ff ff       	call   80100390 <pushcli>
  if(holding(lk))
8010049e:	8b 5d 08             	mov    0x8(%ebp),%ebx
801004a1:	83 ec 0c             	sub    $0xc,%esp
801004a4:	53                   	push   %ebx
801004a5:	e8 96 ff ff ff       	call   80100440 <holding>
801004aa:	83 c4 10             	add    $0x10,%esp
801004ad:	85 c0                	test   %eax,%eax
801004af:	0f 85 7f 00 00 00    	jne    80100534 <acquire+0xa4>
801004b5:	89 c6                	mov    %eax,%esi
  asm volatile("lock; xchgl %0, %1" :
801004b7:	ba 01 00 00 00       	mov    $0x1,%edx
801004bc:	eb 05                	jmp    801004c3 <acquire+0x33>
801004be:	66 90                	xchg   %ax,%ax
801004c0:	8b 5d 08             	mov    0x8(%ebp),%ebx
801004c3:	89 d0                	mov    %edx,%eax
801004c5:	f0 87 03             	lock xchg %eax,(%ebx)
  while(xchg(&lk->locked, 1) != 0)
801004c8:	85 c0                	test   %eax,%eax
801004ca:	75 f4                	jne    801004c0 <acquire+0x30>
  __sync_synchronize();
801004cc:	f0 83 0c 24 00       	lock orl $0x0,(%esp)
  lk->cpu = mycpu();
801004d1:	8b 5d 08             	mov    0x8(%ebp),%ebx
801004d4:	e8 d7 33 00 00       	call   801038b0 <mycpu>
801004d9:	89 43 08             	mov    %eax,0x8(%ebx)
  ebp = (uint*)v - 2;
801004dc:	89 e8                	mov    %ebp,%eax
801004de:	66 90                	xchg   %ax,%ax
    if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
801004e0:	8d 90 00 00 00 80    	lea    -0x80000000(%eax),%edx
801004e6:	81 fa fe ff ff 7f    	cmp    $0x7ffffffe,%edx
801004ec:	77 22                	ja     80100510 <acquire+0x80>
    pcs[i] = ebp[1];     // saved %eip
801004ee:	8b 50 04             	mov    0x4(%eax),%edx
801004f1:	89 54 b3 0c          	mov    %edx,0xc(%ebx,%esi,4)
  for(i = 0; i < 10; i++){
801004f5:	83 c6 01             	add    $0x1,%esi
    ebp = (uint*)ebp[0]; // saved %ebp
801004f8:	8b 00                	mov    (%eax),%eax
  for(i = 0; i < 10; i++){
801004fa:	83 fe 0a             	cmp    $0xa,%esi
801004fd:	75 e1                	jne    801004e0 <acquire+0x50>
}
801004ff:	8d 65 f8             	lea    -0x8(%ebp),%esp
80100502:	5b                   	pop    %ebx
80100503:	5e                   	pop    %esi
80100504:	5d                   	pop    %ebp
80100505:	c3                   	ret    
80100506:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010050d:	8d 76 00             	lea    0x0(%esi),%esi
  for(; i < 10; i++)
80100510:	8d 44 b3 0c          	lea    0xc(%ebx,%esi,4),%eax
80100514:	83 c3 34             	add    $0x34,%ebx
80100517:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010051e:	66 90                	xchg   %ax,%ax
    pcs[i] = 0;
80100520:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
  for(; i < 10; i++)
80100526:	83 c0 04             	add    $0x4,%eax
80100529:	39 d8                	cmp    %ebx,%eax
8010052b:	75 f3                	jne    80100520 <acquire+0x90>
}
8010052d:	8d 65 f8             	lea    -0x8(%ebp),%esp
80100530:	5b                   	pop    %ebx
80100531:	5e                   	pop    %esi
80100532:	5d                   	pop    %ebp
80100533:	c3                   	ret    
    panic("acquire");
80100534:	83 ec 0c             	sub    $0xc,%esp
80100537:	68 7d 72 10 80       	push   $0x8010727d
8010053c:	e8 7f 14 00 00       	call   801019c0 <panic>
80100541:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100548:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010054f:	90                   	nop

80100550 <release>:
{
80100550:	f3 0f 1e fb          	endbr32 
80100554:	55                   	push   %ebp
80100555:	89 e5                	mov    %esp,%ebp
80100557:	53                   	push   %ebx
80100558:	83 ec 10             	sub    $0x10,%esp
8010055b:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if(!holding(lk))
8010055e:	53                   	push   %ebx
8010055f:	e8 dc fe ff ff       	call   80100440 <holding>
80100564:	83 c4 10             	add    $0x10,%esp
80100567:	85 c0                	test   %eax,%eax
80100569:	74 22                	je     8010058d <release+0x3d>
  lk->pcs[0] = 0;
8010056b:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
  lk->cpu = 0;
80100572:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
  __sync_synchronize();
80100579:	f0 83 0c 24 00       	lock orl $0x0,(%esp)
  asm volatile("movl $0, %0" : "+m" (lk->locked) : );
8010057e:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
}
80100584:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80100587:	c9                   	leave  
  popcli();
80100588:	e9 53 fe ff ff       	jmp    801003e0 <popcli>
    panic("release");
8010058d:	83 ec 0c             	sub    $0xc,%esp
80100590:	68 85 72 10 80       	push   $0x80107285
80100595:	e8 26 14 00 00       	call   801019c0 <panic>
8010059a:	66 90                	xchg   %ax,%ax
8010059c:	66 90                	xchg   %ax,%ax
8010059e:	66 90                	xchg   %ax,%ax

801005a0 <picinit>:
#define IO_PIC2         0xA0    // Slave (IRQs 8-15)

// Don't use the 8259A interrupt controllers.  Xv6 assumes SMP hardware.
void
picinit(void)
{
801005a0:	f3 0f 1e fb          	endbr32 
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
801005a4:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
801005a9:	ba 21 00 00 00       	mov    $0x21,%edx
801005ae:	ee                   	out    %al,(%dx)
801005af:	ba a1 00 00 00       	mov    $0xa1,%edx
801005b4:	ee                   	out    %al,(%dx)
  // mask all interrupts
  outb(IO_PIC1+1, 0xFF);
  outb(IO_PIC2+1, 0xFF);
}
801005b5:	c3                   	ret    
801005b6:	66 90                	xchg   %ax,%ax
801005b8:	66 90                	xchg   %ax,%ax
801005ba:	66 90                	xchg   %ax,%ax
801005bc:	66 90                	xchg   %ax,%ax
801005be:	66 90                	xchg   %ax,%ax

801005c0 <ioapicinit>:
  ioapic->data = data;
}

void
ioapicinit(void)
{
801005c0:	f3 0f 1e fb          	endbr32 
801005c4:	55                   	push   %ebp
  int i, id, maxintr;

  ioapic = (volatile struct ioapic*)IOAPIC;
801005c5:	c7 05 e0 a8 10 80 00 	movl   $0xfec00000,0x8010a8e0
801005cc:	00 c0 fe 
{
801005cf:	89 e5                	mov    %esp,%ebp
801005d1:	56                   	push   %esi
801005d2:	53                   	push   %ebx
  ioapic->reg = reg;
801005d3:	c7 05 00 00 c0 fe 01 	movl   $0x1,0xfec00000
801005da:	00 00 00 
  return ioapic->data;
801005dd:	8b 15 e0 a8 10 80    	mov    0x8010a8e0,%edx
801005e3:	8b 72 10             	mov    0x10(%edx),%esi
  ioapic->reg = reg;
801005e6:	c7 02 00 00 00 00    	movl   $0x0,(%edx)
  return ioapic->data;
801005ec:	8b 0d e0 a8 10 80    	mov    0x8010a8e0,%ecx
  maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
  id = ioapicread(REG_ID) >> 24;
  if(id != ioapicid)
801005f2:	0f b6 15 00 a9 10 80 	movzbl 0x8010a900,%edx
  maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
801005f9:	c1 ee 10             	shr    $0x10,%esi
801005fc:	89 f0                	mov    %esi,%eax
801005fe:	0f b6 f0             	movzbl %al,%esi
  return ioapic->data;
80100601:	8b 41 10             	mov    0x10(%ecx),%eax
  id = ioapicread(REG_ID) >> 24;
80100604:	c1 e8 18             	shr    $0x18,%eax
  if(id != ioapicid)
80100607:	39 c2                	cmp    %eax,%edx
80100609:	74 16                	je     80100621 <ioapicinit+0x61>
    cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
8010060b:	83 ec 0c             	sub    $0xc,%esp
8010060e:	68 90 72 10 80       	push   $0x80107290
80100613:	e8 c8 16 00 00       	call   80101ce0 <cprintf>
80100618:	8b 0d e0 a8 10 80    	mov    0x8010a8e0,%ecx
8010061e:	83 c4 10             	add    $0x10,%esp
80100621:	83 c6 21             	add    $0x21,%esi
{
80100624:	ba 10 00 00 00       	mov    $0x10,%edx
80100629:	b8 20 00 00 00       	mov    $0x20,%eax
8010062e:	66 90                	xchg   %ax,%ax
  ioapic->reg = reg;
80100630:	89 11                	mov    %edx,(%ecx)

  // Mark all interrupts edge-triggered, active high, disabled,
  // and not routed to any CPUs.
  for(i = 0; i <= maxintr; i++){
    ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i));
80100632:	89 c3                	mov    %eax,%ebx
  ioapic->data = data;
80100634:	8b 0d e0 a8 10 80    	mov    0x8010a8e0,%ecx
8010063a:	83 c0 01             	add    $0x1,%eax
    ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i));
8010063d:	81 cb 00 00 01 00    	or     $0x10000,%ebx
  ioapic->data = data;
80100643:	89 59 10             	mov    %ebx,0x10(%ecx)
  ioapic->reg = reg;
80100646:	8d 5a 01             	lea    0x1(%edx),%ebx
80100649:	83 c2 02             	add    $0x2,%edx
8010064c:	89 19                	mov    %ebx,(%ecx)
  ioapic->data = data;
8010064e:	8b 0d e0 a8 10 80    	mov    0x8010a8e0,%ecx
80100654:	c7 41 10 00 00 00 00 	movl   $0x0,0x10(%ecx)
  for(i = 0; i <= maxintr; i++){
8010065b:	39 f0                	cmp    %esi,%eax
8010065d:	75 d1                	jne    80100630 <ioapicinit+0x70>
    ioapicwrite(REG_TABLE+2*i+1, 0);
  }
}
8010065f:	8d 65 f8             	lea    -0x8(%ebp),%esp
80100662:	5b                   	pop    %ebx
80100663:	5e                   	pop    %esi
80100664:	5d                   	pop    %ebp
80100665:	c3                   	ret    
80100666:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010066d:	8d 76 00             	lea    0x0(%esi),%esi

80100670 <ioapicenable>:

void
ioapicenable(int irq, int cpunum)
{
80100670:	f3 0f 1e fb          	endbr32 
80100674:	55                   	push   %ebp
  ioapic->reg = reg;
80100675:	8b 0d e0 a8 10 80    	mov    0x8010a8e0,%ecx
{
8010067b:	89 e5                	mov    %esp,%ebp
8010067d:	8b 45 08             	mov    0x8(%ebp),%eax
  // Mark interrupt edge-triggered, active high,
  // enabled, and routed to the given cpunum,
  // which happens to be that cpu's APIC ID.
  ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq);
80100680:	8d 50 20             	lea    0x20(%eax),%edx
80100683:	8d 44 00 10          	lea    0x10(%eax,%eax,1),%eax
  ioapic->reg = reg;
80100687:	89 01                	mov    %eax,(%ecx)
  ioapic->data = data;
80100689:	8b 0d e0 a8 10 80    	mov    0x8010a8e0,%ecx
  ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
8010068f:	83 c0 01             	add    $0x1,%eax
  ioapic->data = data;
80100692:	89 51 10             	mov    %edx,0x10(%ecx)
  ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
80100695:	8b 55 0c             	mov    0xc(%ebp),%edx
  ioapic->reg = reg;
80100698:	89 01                	mov    %eax,(%ecx)
  ioapic->data = data;
8010069a:	a1 e0 a8 10 80       	mov    0x8010a8e0,%eax
  ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
8010069f:	c1 e2 18             	shl    $0x18,%edx
  ioapic->data = data;
801006a2:	89 50 10             	mov    %edx,0x10(%eax)
}
801006a5:	5d                   	pop    %ebp
801006a6:	c3                   	ret    
801006a7:	66 90                	xchg   %ax,%ax
801006a9:	66 90                	xchg   %ax,%ax
801006ab:	66 90                	xchg   %ax,%ax
801006ad:	66 90                	xchg   %ax,%ax
801006af:	90                   	nop

801006b0 <lapicinit>:
  lapic[ID];  // wait for write to finish, by reading
}

void
lapicinit(void)
{
801006b0:	f3 0f 1e fb          	endbr32 
  if(!lapic)
801006b4:	a1 e4 a8 10 80       	mov    0x8010a8e4,%eax
801006b9:	85 c0                	test   %eax,%eax
801006bb:	0f 84 c7 00 00 00    	je     80100788 <lapicinit+0xd8>
  lapic[index] = value;
801006c1:	c7 80 f0 00 00 00 3f 	movl   $0x13f,0xf0(%eax)
801006c8:	01 00 00 
  lapic[ID];  // wait for write to finish, by reading
801006cb:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
801006ce:	c7 80 e0 03 00 00 0b 	movl   $0xb,0x3e0(%eax)
801006d5:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
801006d8:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
801006db:	c7 80 20 03 00 00 20 	movl   $0x20020,0x320(%eax)
801006e2:	00 02 00 
  lapic[ID];  // wait for write to finish, by reading
801006e5:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
801006e8:	c7 80 80 03 00 00 80 	movl   $0x989680,0x380(%eax)
801006ef:	96 98 00 
  lapic[ID];  // wait for write to finish, by reading
801006f2:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
801006f5:	c7 80 50 03 00 00 00 	movl   $0x10000,0x350(%eax)
801006fc:	00 01 00 
  lapic[ID];  // wait for write to finish, by reading
801006ff:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
80100702:	c7 80 60 03 00 00 00 	movl   $0x10000,0x360(%eax)
80100709:	00 01 00 
  lapic[ID];  // wait for write to finish, by reading
8010070c:	8b 50 20             	mov    0x20(%eax),%edx
  lapicw(LINT0, MASKED);
  lapicw(LINT1, MASKED);

  // Disable performance counter overflow interrupts
  // on machines that provide that interrupt entry.
  if(((lapic[VER]>>16) & 0xFF) >= 4)
8010070f:	8b 50 30             	mov    0x30(%eax),%edx
80100712:	c1 ea 10             	shr    $0x10,%edx
80100715:	81 e2 fc 00 00 00    	and    $0xfc,%edx
8010071b:	75 73                	jne    80100790 <lapicinit+0xe0>
  lapic[index] = value;
8010071d:	c7 80 70 03 00 00 33 	movl   $0x33,0x370(%eax)
80100724:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
80100727:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
8010072a:	c7 80 80 02 00 00 00 	movl   $0x0,0x280(%eax)
80100731:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
80100734:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
80100737:	c7 80 80 02 00 00 00 	movl   $0x0,0x280(%eax)
8010073e:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
80100741:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
80100744:	c7 80 b0 00 00 00 00 	movl   $0x0,0xb0(%eax)
8010074b:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
8010074e:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
80100751:	c7 80 10 03 00 00 00 	movl   $0x0,0x310(%eax)
80100758:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
8010075b:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
8010075e:	c7 80 00 03 00 00 00 	movl   $0x88500,0x300(%eax)
80100765:	85 08 00 
  lapic[ID];  // wait for write to finish, by reading
80100768:	8b 50 20             	mov    0x20(%eax),%edx
8010076b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010076f:	90                   	nop
  lapicw(EOI, 0);

  // Send an Init Level De-Assert to synchronise arbitration ID's.
  lapicw(ICRHI, 0);
  lapicw(ICRLO, BCAST | INIT | LEVEL);
  while(lapic[ICRLO] & DELIVS)
80100770:	8b 90 00 03 00 00    	mov    0x300(%eax),%edx
80100776:	80 e6 10             	and    $0x10,%dh
80100779:	75 f5                	jne    80100770 <lapicinit+0xc0>
  lapic[index] = value;
8010077b:	c7 80 80 00 00 00 00 	movl   $0x0,0x80(%eax)
80100782:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
80100785:	8b 40 20             	mov    0x20(%eax),%eax
    ;

  // Enable interrupts on the APIC (but not on the processor).
  lapicw(TPR, 0);
}
80100788:	c3                   	ret    
80100789:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  lapic[index] = value;
80100790:	c7 80 40 03 00 00 00 	movl   $0x10000,0x340(%eax)
80100797:	00 01 00 
  lapic[ID];  // wait for write to finish, by reading
8010079a:	8b 50 20             	mov    0x20(%eax),%edx
}
8010079d:	e9 7b ff ff ff       	jmp    8010071d <lapicinit+0x6d>
801007a2:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801007a9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

801007b0 <lapicid>:

int
lapicid(void)
{
801007b0:	f3 0f 1e fb          	endbr32 
  if (!lapic)
801007b4:	a1 e4 a8 10 80       	mov    0x8010a8e4,%eax
801007b9:	85 c0                	test   %eax,%eax
801007bb:	74 0b                	je     801007c8 <lapicid+0x18>
    return 0;
  return lapic[ID] >> 24;
801007bd:	8b 40 20             	mov    0x20(%eax),%eax
801007c0:	c1 e8 18             	shr    $0x18,%eax
801007c3:	c3                   	ret    
801007c4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    return 0;
801007c8:	31 c0                	xor    %eax,%eax
}
801007ca:	c3                   	ret    
801007cb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801007cf:	90                   	nop

801007d0 <lapiceoi>:

// Acknowledge interrupt.
void
lapiceoi(void)
{
801007d0:	f3 0f 1e fb          	endbr32 
  if(lapic)
801007d4:	a1 e4 a8 10 80       	mov    0x8010a8e4,%eax
801007d9:	85 c0                	test   %eax,%eax
801007db:	74 0d                	je     801007ea <lapiceoi+0x1a>
  lapic[index] = value;
801007dd:	c7 80 b0 00 00 00 00 	movl   $0x0,0xb0(%eax)
801007e4:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
801007e7:	8b 40 20             	mov    0x20(%eax),%eax
    lapicw(EOI, 0);
}
801007ea:	c3                   	ret    
801007eb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801007ef:	90                   	nop

801007f0 <microdelay>:

// Spin for a given number of microseconds.
// On real hardware would want to tune this dynamically.
void
microdelay(int us)
{
801007f0:	f3 0f 1e fb          	endbr32 
}
801007f4:	c3                   	ret    
801007f5:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801007fc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80100800 <lapicstartap>:

// Start additional processor running entry code at addr.
// See Appendix B of MultiProcessor Specification.
void
lapicstartap(uchar apicid, uint addr)
{
80100800:	f3 0f 1e fb          	endbr32 
80100804:	55                   	push   %ebp
80100805:	b8 0f 00 00 00       	mov    $0xf,%eax
8010080a:	ba 70 00 00 00       	mov    $0x70,%edx
8010080f:	89 e5                	mov    %esp,%ebp
80100811:	53                   	push   %ebx
80100812:	8b 4d 0c             	mov    0xc(%ebp),%ecx
80100815:	8b 5d 08             	mov    0x8(%ebp),%ebx
80100818:	ee                   	out    %al,(%dx)
80100819:	b8 0a 00 00 00       	mov    $0xa,%eax
8010081e:	ba 71 00 00 00       	mov    $0x71,%edx
80100823:	ee                   	out    %al,(%dx)
  // and the warm reset vector (DWORD based at 40:67) to point at
  // the AP startup code prior to the [universal startup algorithm]."
  outb(CMOS_PORT, 0xF);  // offset 0xF is shutdown code
  outb(CMOS_PORT+1, 0x0A);
  wrv = (ushort*)P2V((0x40<<4 | 0x67));  // Warm reset vector
  wrv[0] = 0;
80100824:	31 c0                	xor    %eax,%eax
  wrv[1] = addr >> 4;

  // "Universal startup algorithm."
  // Send INIT (level-triggered) interrupt to reset other CPU.
  lapicw(ICRHI, apicid<<24);
80100826:	c1 e3 18             	shl    $0x18,%ebx
  wrv[0] = 0;
80100829:	66 a3 67 04 00 80    	mov    %ax,0x80000467
  wrv[1] = addr >> 4;
8010082f:	89 c8                	mov    %ecx,%eax
  // when it is in the halted state due to an INIT.  So the second
  // should be ignored, but it is part of the official Intel algorithm.
  // Bochs complains about the second one.  Too bad for Bochs.
  for(i = 0; i < 2; i++){
    lapicw(ICRHI, apicid<<24);
    lapicw(ICRLO, STARTUP | (addr>>12));
80100831:	c1 e9 0c             	shr    $0xc,%ecx
  lapicw(ICRHI, apicid<<24);
80100834:	89 da                	mov    %ebx,%edx
  wrv[1] = addr >> 4;
80100836:	c1 e8 04             	shr    $0x4,%eax
    lapicw(ICRLO, STARTUP | (addr>>12));
80100839:	80 cd 06             	or     $0x6,%ch
  wrv[1] = addr >> 4;
8010083c:	66 a3 69 04 00 80    	mov    %ax,0x80000469
  lapic[index] = value;
80100842:	a1 e4 a8 10 80       	mov    0x8010a8e4,%eax
80100847:	89 98 10 03 00 00    	mov    %ebx,0x310(%eax)
  lapic[ID];  // wait for write to finish, by reading
8010084d:	8b 58 20             	mov    0x20(%eax),%ebx
  lapic[index] = value;
80100850:	c7 80 00 03 00 00 00 	movl   $0xc500,0x300(%eax)
80100857:	c5 00 00 
  lapic[ID];  // wait for write to finish, by reading
8010085a:	8b 58 20             	mov    0x20(%eax),%ebx
  lapic[index] = value;
8010085d:	c7 80 00 03 00 00 00 	movl   $0x8500,0x300(%eax)
80100864:	85 00 00 
  lapic[ID];  // wait for write to finish, by reading
80100867:	8b 58 20             	mov    0x20(%eax),%ebx
  lapic[index] = value;
8010086a:	89 90 10 03 00 00    	mov    %edx,0x310(%eax)
  lapic[ID];  // wait for write to finish, by reading
80100870:	8b 58 20             	mov    0x20(%eax),%ebx
  lapic[index] = value;
80100873:	89 88 00 03 00 00    	mov    %ecx,0x300(%eax)
  lapic[ID];  // wait for write to finish, by reading
80100879:	8b 58 20             	mov    0x20(%eax),%ebx
  lapic[index] = value;
8010087c:	89 90 10 03 00 00    	mov    %edx,0x310(%eax)
  lapic[ID];  // wait for write to finish, by reading
80100882:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
80100885:	89 88 00 03 00 00    	mov    %ecx,0x300(%eax)
    microdelay(200);
  }
}
8010088b:	5b                   	pop    %ebx
  lapic[ID];  // wait for write to finish, by reading
8010088c:	8b 40 20             	mov    0x20(%eax),%eax
}
8010088f:	5d                   	pop    %ebp
80100890:	c3                   	ret    
80100891:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100898:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010089f:	90                   	nop

801008a0 <cmostime>:
}

// qemu seems to use 24-hour GWT and the values are BCD encoded
void
cmostime(struct rtcdate *r)
{
801008a0:	f3 0f 1e fb          	endbr32 
801008a4:	55                   	push   %ebp
801008a5:	b8 0b 00 00 00       	mov    $0xb,%eax
801008aa:	ba 70 00 00 00       	mov    $0x70,%edx
801008af:	89 e5                	mov    %esp,%ebp
801008b1:	57                   	push   %edi
801008b2:	56                   	push   %esi
801008b3:	53                   	push   %ebx
801008b4:	83 ec 4c             	sub    $0x4c,%esp
801008b7:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801008b8:	ba 71 00 00 00       	mov    $0x71,%edx
801008bd:	ec                   	in     (%dx),%al
  struct rtcdate t1, t2;
  int sb, bcd;

  sb = cmos_read(CMOS_STATB);

  bcd = (sb & (1 << 2)) == 0;
801008be:	83 e0 04             	and    $0x4,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
801008c1:	bb 70 00 00 00       	mov    $0x70,%ebx
801008c6:	88 45 b3             	mov    %al,-0x4d(%ebp)
801008c9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801008d0:	31 c0                	xor    %eax,%eax
801008d2:	89 da                	mov    %ebx,%edx
801008d4:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801008d5:	b9 71 00 00 00       	mov    $0x71,%ecx
801008da:	89 ca                	mov    %ecx,%edx
801008dc:	ec                   	in     (%dx),%al
801008dd:	88 45 b7             	mov    %al,-0x49(%ebp)
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
801008e0:	89 da                	mov    %ebx,%edx
801008e2:	b8 02 00 00 00       	mov    $0x2,%eax
801008e7:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801008e8:	89 ca                	mov    %ecx,%edx
801008ea:	ec                   	in     (%dx),%al
801008eb:	88 45 b6             	mov    %al,-0x4a(%ebp)
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
801008ee:	89 da                	mov    %ebx,%edx
801008f0:	b8 04 00 00 00       	mov    $0x4,%eax
801008f5:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801008f6:	89 ca                	mov    %ecx,%edx
801008f8:	ec                   	in     (%dx),%al
801008f9:	88 45 b5             	mov    %al,-0x4b(%ebp)
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
801008fc:	89 da                	mov    %ebx,%edx
801008fe:	b8 07 00 00 00       	mov    $0x7,%eax
80100903:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80100904:	89 ca                	mov    %ecx,%edx
80100906:	ec                   	in     (%dx),%al
80100907:	88 45 b4             	mov    %al,-0x4c(%ebp)
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010090a:	89 da                	mov    %ebx,%edx
8010090c:	b8 08 00 00 00       	mov    $0x8,%eax
80100911:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80100912:	89 ca                	mov    %ecx,%edx
80100914:	ec                   	in     (%dx),%al
80100915:	89 c7                	mov    %eax,%edi
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80100917:	89 da                	mov    %ebx,%edx
80100919:	b8 09 00 00 00       	mov    $0x9,%eax
8010091e:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010091f:	89 ca                	mov    %ecx,%edx
80100921:	ec                   	in     (%dx),%al
80100922:	89 c6                	mov    %eax,%esi
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80100924:	89 da                	mov    %ebx,%edx
80100926:	b8 0a 00 00 00       	mov    $0xa,%eax
8010092b:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010092c:	89 ca                	mov    %ecx,%edx
8010092e:	ec                   	in     (%dx),%al

  // make sure CMOS doesn't modify time while we read it
  for(;;) {
    fill_rtcdate(&t1);
    if(cmos_read(CMOS_STATA) & CMOS_UIP)
8010092f:	84 c0                	test   %al,%al
80100931:	78 9d                	js     801008d0 <cmostime+0x30>
  return inb(CMOS_RETURN);
80100933:	0f b6 45 b7          	movzbl -0x49(%ebp),%eax
80100937:	89 fa                	mov    %edi,%edx
80100939:	0f b6 fa             	movzbl %dl,%edi
8010093c:	89 f2                	mov    %esi,%edx
8010093e:	89 45 b8             	mov    %eax,-0x48(%ebp)
80100941:	0f b6 45 b6          	movzbl -0x4a(%ebp),%eax
80100945:	0f b6 f2             	movzbl %dl,%esi
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80100948:	89 da                	mov    %ebx,%edx
8010094a:	89 7d c8             	mov    %edi,-0x38(%ebp)
8010094d:	89 45 bc             	mov    %eax,-0x44(%ebp)
80100950:	0f b6 45 b5          	movzbl -0x4b(%ebp),%eax
80100954:	89 75 cc             	mov    %esi,-0x34(%ebp)
80100957:	89 45 c0             	mov    %eax,-0x40(%ebp)
8010095a:	0f b6 45 b4          	movzbl -0x4c(%ebp),%eax
8010095e:	89 45 c4             	mov    %eax,-0x3c(%ebp)
80100961:	31 c0                	xor    %eax,%eax
80100963:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80100964:	89 ca                	mov    %ecx,%edx
80100966:	ec                   	in     (%dx),%al
80100967:	0f b6 c0             	movzbl %al,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010096a:	89 da                	mov    %ebx,%edx
8010096c:	89 45 d0             	mov    %eax,-0x30(%ebp)
8010096f:	b8 02 00 00 00       	mov    $0x2,%eax
80100974:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80100975:	89 ca                	mov    %ecx,%edx
80100977:	ec                   	in     (%dx),%al
80100978:	0f b6 c0             	movzbl %al,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010097b:	89 da                	mov    %ebx,%edx
8010097d:	89 45 d4             	mov    %eax,-0x2c(%ebp)
80100980:	b8 04 00 00 00       	mov    $0x4,%eax
80100985:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80100986:	89 ca                	mov    %ecx,%edx
80100988:	ec                   	in     (%dx),%al
80100989:	0f b6 c0             	movzbl %al,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010098c:	89 da                	mov    %ebx,%edx
8010098e:	89 45 d8             	mov    %eax,-0x28(%ebp)
80100991:	b8 07 00 00 00       	mov    $0x7,%eax
80100996:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80100997:	89 ca                	mov    %ecx,%edx
80100999:	ec                   	in     (%dx),%al
8010099a:	0f b6 c0             	movzbl %al,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010099d:	89 da                	mov    %ebx,%edx
8010099f:	89 45 dc             	mov    %eax,-0x24(%ebp)
801009a2:	b8 08 00 00 00       	mov    $0x8,%eax
801009a7:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801009a8:	89 ca                	mov    %ecx,%edx
801009aa:	ec                   	in     (%dx),%al
801009ab:	0f b6 c0             	movzbl %al,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
801009ae:	89 da                	mov    %ebx,%edx
801009b0:	89 45 e0             	mov    %eax,-0x20(%ebp)
801009b3:	b8 09 00 00 00       	mov    $0x9,%eax
801009b8:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801009b9:	89 ca                	mov    %ecx,%edx
801009bb:	ec                   	in     (%dx),%al
801009bc:	0f b6 c0             	movzbl %al,%eax
        continue;
    fill_rtcdate(&t2);
    if(memcmp(&t1, &t2, sizeof(t1)) == 0)
801009bf:	83 ec 04             	sub    $0x4,%esp
  return inb(CMOS_RETURN);
801009c2:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    if(memcmp(&t1, &t2, sizeof(t1)) == 0)
801009c5:	8d 45 d0             	lea    -0x30(%ebp),%eax
801009c8:	6a 18                	push   $0x18
801009ca:	50                   	push   %eax
801009cb:	8d 45 b8             	lea    -0x48(%ebp),%eax
801009ce:	50                   	push   %eax
801009cf:	e8 4c 48 00 00       	call   80105220 <memcmp>
801009d4:	83 c4 10             	add    $0x10,%esp
801009d7:	85 c0                	test   %eax,%eax
801009d9:	0f 85 f1 fe ff ff    	jne    801008d0 <cmostime+0x30>
      break;
  }

  // convert
  if(bcd) {
801009df:	80 7d b3 00          	cmpb   $0x0,-0x4d(%ebp)
801009e3:	75 78                	jne    80100a5d <cmostime+0x1bd>
#define    CONV(x)     (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf))
    CONV(second);
801009e5:	8b 45 b8             	mov    -0x48(%ebp),%eax
801009e8:	89 c2                	mov    %eax,%edx
801009ea:	83 e0 0f             	and    $0xf,%eax
801009ed:	c1 ea 04             	shr    $0x4,%edx
801009f0:	8d 14 92             	lea    (%edx,%edx,4),%edx
801009f3:	8d 04 50             	lea    (%eax,%edx,2),%eax
801009f6:	89 45 b8             	mov    %eax,-0x48(%ebp)
    CONV(minute);
801009f9:	8b 45 bc             	mov    -0x44(%ebp),%eax
801009fc:	89 c2                	mov    %eax,%edx
801009fe:	83 e0 0f             	and    $0xf,%eax
80100a01:	c1 ea 04             	shr    $0x4,%edx
80100a04:	8d 14 92             	lea    (%edx,%edx,4),%edx
80100a07:	8d 04 50             	lea    (%eax,%edx,2),%eax
80100a0a:	89 45 bc             	mov    %eax,-0x44(%ebp)
    CONV(hour  );
80100a0d:	8b 45 c0             	mov    -0x40(%ebp),%eax
80100a10:	89 c2                	mov    %eax,%edx
80100a12:	83 e0 0f             	and    $0xf,%eax
80100a15:	c1 ea 04             	shr    $0x4,%edx
80100a18:	8d 14 92             	lea    (%edx,%edx,4),%edx
80100a1b:	8d 04 50             	lea    (%eax,%edx,2),%eax
80100a1e:	89 45 c0             	mov    %eax,-0x40(%ebp)
    CONV(day   );
80100a21:	8b 45 c4             	mov    -0x3c(%ebp),%eax
80100a24:	89 c2                	mov    %eax,%edx
80100a26:	83 e0 0f             	and    $0xf,%eax
80100a29:	c1 ea 04             	shr    $0x4,%edx
80100a2c:	8d 14 92             	lea    (%edx,%edx,4),%edx
80100a2f:	8d 04 50             	lea    (%eax,%edx,2),%eax
80100a32:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    CONV(month );
80100a35:	8b 45 c8             	mov    -0x38(%ebp),%eax
80100a38:	89 c2                	mov    %eax,%edx
80100a3a:	83 e0 0f             	and    $0xf,%eax
80100a3d:	c1 ea 04             	shr    $0x4,%edx
80100a40:	8d 14 92             	lea    (%edx,%edx,4),%edx
80100a43:	8d 04 50             	lea    (%eax,%edx,2),%eax
80100a46:	89 45 c8             	mov    %eax,-0x38(%ebp)
    CONV(year  );
80100a49:	8b 45 cc             	mov    -0x34(%ebp),%eax
80100a4c:	89 c2                	mov    %eax,%edx
80100a4e:	83 e0 0f             	and    $0xf,%eax
80100a51:	c1 ea 04             	shr    $0x4,%edx
80100a54:	8d 14 92             	lea    (%edx,%edx,4),%edx
80100a57:	8d 04 50             	lea    (%eax,%edx,2),%eax
80100a5a:	89 45 cc             	mov    %eax,-0x34(%ebp)
#undef     CONV
  }

  *r = t1;
80100a5d:	8b 75 08             	mov    0x8(%ebp),%esi
80100a60:	8b 45 b8             	mov    -0x48(%ebp),%eax
80100a63:	89 06                	mov    %eax,(%esi)
80100a65:	8b 45 bc             	mov    -0x44(%ebp),%eax
80100a68:	89 46 04             	mov    %eax,0x4(%esi)
80100a6b:	8b 45 c0             	mov    -0x40(%ebp),%eax
80100a6e:	89 46 08             	mov    %eax,0x8(%esi)
80100a71:	8b 45 c4             	mov    -0x3c(%ebp),%eax
80100a74:	89 46 0c             	mov    %eax,0xc(%esi)
80100a77:	8b 45 c8             	mov    -0x38(%ebp),%eax
80100a7a:	89 46 10             	mov    %eax,0x10(%esi)
80100a7d:	8b 45 cc             	mov    -0x34(%ebp),%eax
80100a80:	89 46 14             	mov    %eax,0x14(%esi)
  r->year += 2000;
80100a83:	81 46 14 d0 07 00 00 	addl   $0x7d0,0x14(%esi)
}
80100a8a:	8d 65 f4             	lea    -0xc(%ebp),%esp
80100a8d:	5b                   	pop    %ebx
80100a8e:	5e                   	pop    %esi
80100a8f:	5f                   	pop    %edi
80100a90:	5d                   	pop    %ebp
80100a91:	c3                   	ret    
80100a92:	66 90                	xchg   %ax,%ax
80100a94:	66 90                	xchg   %ax,%ax
80100a96:	66 90                	xchg   %ax,%ax
80100a98:	66 90                	xchg   %ax,%ax
80100a9a:	66 90                	xchg   %ax,%ax
80100a9c:	66 90                	xchg   %ax,%ax
80100a9e:	66 90                	xchg   %ax,%ax

80100aa0 <mpsearch1>:
}

// Look for an MP structure in the len bytes at addr.
static struct mp*
mpsearch1(uint a, int len)
{
80100aa0:	55                   	push   %ebp
80100aa1:	89 e5                	mov    %esp,%ebp
80100aa3:	57                   	push   %edi
80100aa4:	56                   	push   %esi
  uchar *e, *p, *addr;

  addr = P2V(a);
80100aa5:	8d b0 00 00 00 80    	lea    -0x80000000(%eax),%esi
{
80100aab:	53                   	push   %ebx
  e = addr+len;
80100aac:	8d 1c 16             	lea    (%esi,%edx,1),%ebx
{
80100aaf:	83 ec 0c             	sub    $0xc,%esp
  for(p = addr; p < e; p += sizeof(struct mp))
80100ab2:	39 de                	cmp    %ebx,%esi
80100ab4:	72 10                	jb     80100ac6 <mpsearch1+0x26>
80100ab6:	eb 50                	jmp    80100b08 <mpsearch1+0x68>
80100ab8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100abf:	90                   	nop
80100ac0:	89 fe                	mov    %edi,%esi
80100ac2:	39 fb                	cmp    %edi,%ebx
80100ac4:	76 42                	jbe    80100b08 <mpsearch1+0x68>
    if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
80100ac6:	83 ec 04             	sub    $0x4,%esp
80100ac9:	8d 7e 10             	lea    0x10(%esi),%edi
80100acc:	6a 04                	push   $0x4
80100ace:	68 c2 72 10 80       	push   $0x801072c2
80100ad3:	56                   	push   %esi
80100ad4:	e8 47 47 00 00       	call   80105220 <memcmp>
80100ad9:	83 c4 10             	add    $0x10,%esp
80100adc:	85 c0                	test   %eax,%eax
80100ade:	75 e0                	jne    80100ac0 <mpsearch1+0x20>
80100ae0:	89 f2                	mov    %esi,%edx
80100ae2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    sum += addr[i];
80100ae8:	0f b6 0a             	movzbl (%edx),%ecx
80100aeb:	83 c2 01             	add    $0x1,%edx
80100aee:	01 c8                	add    %ecx,%eax
  for(i=0; i<len; i++)
80100af0:	39 fa                	cmp    %edi,%edx
80100af2:	75 f4                	jne    80100ae8 <mpsearch1+0x48>
    if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
80100af4:	84 c0                	test   %al,%al
80100af6:	75 c8                	jne    80100ac0 <mpsearch1+0x20>
      return (struct mp*)p;
  return 0;
}
80100af8:	8d 65 f4             	lea    -0xc(%ebp),%esp
80100afb:	89 f0                	mov    %esi,%eax
80100afd:	5b                   	pop    %ebx
80100afe:	5e                   	pop    %esi
80100aff:	5f                   	pop    %edi
80100b00:	5d                   	pop    %ebp
80100b01:	c3                   	ret    
80100b02:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80100b08:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return 0;
80100b0b:	31 f6                	xor    %esi,%esi
}
80100b0d:	5b                   	pop    %ebx
80100b0e:	89 f0                	mov    %esi,%eax
80100b10:	5e                   	pop    %esi
80100b11:	5f                   	pop    %edi
80100b12:	5d                   	pop    %ebp
80100b13:	c3                   	ret    
80100b14:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100b1b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80100b1f:	90                   	nop

80100b20 <mpinit>:
  return conf;
}

void
mpinit(void)
{
80100b20:	f3 0f 1e fb          	endbr32 
80100b24:	55                   	push   %ebp
80100b25:	89 e5                	mov    %esp,%ebp
80100b27:	57                   	push   %edi
80100b28:	56                   	push   %esi
80100b29:	53                   	push   %ebx
80100b2a:	83 ec 1c             	sub    $0x1c,%esp
  if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){
80100b2d:	0f b6 05 0f 04 00 80 	movzbl 0x8000040f,%eax
80100b34:	0f b6 15 0e 04 00 80 	movzbl 0x8000040e,%edx
80100b3b:	c1 e0 08             	shl    $0x8,%eax
80100b3e:	09 d0                	or     %edx,%eax
80100b40:	c1 e0 04             	shl    $0x4,%eax
80100b43:	75 1b                	jne    80100b60 <mpinit+0x40>
    p = ((bda[0x14]<<8)|bda[0x13])*1024;
80100b45:	0f b6 05 14 04 00 80 	movzbl 0x80000414,%eax
80100b4c:	0f b6 15 13 04 00 80 	movzbl 0x80000413,%edx
80100b53:	c1 e0 08             	shl    $0x8,%eax
80100b56:	09 d0                	or     %edx,%eax
80100b58:	c1 e0 0a             	shl    $0xa,%eax
    if((mp = mpsearch1(p-1024, 1024)))
80100b5b:	2d 00 04 00 00       	sub    $0x400,%eax
    if((mp = mpsearch1(p, 1024)))
80100b60:	ba 00 04 00 00       	mov    $0x400,%edx
80100b65:	e8 36 ff ff ff       	call   80100aa0 <mpsearch1>
80100b6a:	89 c6                	mov    %eax,%esi
80100b6c:	85 c0                	test   %eax,%eax
80100b6e:	0f 84 4c 01 00 00    	je     80100cc0 <mpinit+0x1a0>
  if((mp = mpsearch()) == 0 || mp->physaddr == 0)
80100b74:	8b 5e 04             	mov    0x4(%esi),%ebx
80100b77:	85 db                	test   %ebx,%ebx
80100b79:	0f 84 61 01 00 00    	je     80100ce0 <mpinit+0x1c0>
  if(memcmp(conf, "PCMP", 4) != 0)
80100b7f:	83 ec 04             	sub    $0x4,%esp
  conf = (struct mpconf*) P2V((uint) mp->physaddr);
80100b82:	8d 83 00 00 00 80    	lea    -0x80000000(%ebx),%eax
  if(memcmp(conf, "PCMP", 4) != 0)
80100b88:	6a 04                	push   $0x4
80100b8a:	68 c7 72 10 80       	push   $0x801072c7
80100b8f:	50                   	push   %eax
  conf = (struct mpconf*) P2V((uint) mp->physaddr);
80100b90:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  if(memcmp(conf, "PCMP", 4) != 0)
80100b93:	e8 88 46 00 00       	call   80105220 <memcmp>
80100b98:	83 c4 10             	add    $0x10,%esp
80100b9b:	85 c0                	test   %eax,%eax
80100b9d:	0f 85 3d 01 00 00    	jne    80100ce0 <mpinit+0x1c0>
  if(conf->version != 1 && conf->version != 4)
80100ba3:	0f b6 83 06 00 00 80 	movzbl -0x7ffffffa(%ebx),%eax
80100baa:	3c 01                	cmp    $0x1,%al
80100bac:	74 08                	je     80100bb6 <mpinit+0x96>
80100bae:	3c 04                	cmp    $0x4,%al
80100bb0:	0f 85 2a 01 00 00    	jne    80100ce0 <mpinit+0x1c0>
  if(sum((uchar*)conf, conf->length) != 0)
80100bb6:	0f b7 93 04 00 00 80 	movzwl -0x7ffffffc(%ebx),%edx
  for(i=0; i<len; i++)
80100bbd:	66 85 d2             	test   %dx,%dx
80100bc0:	74 26                	je     80100be8 <mpinit+0xc8>
80100bc2:	8d 3c 1a             	lea    (%edx,%ebx,1),%edi
80100bc5:	89 d8                	mov    %ebx,%eax
  sum = 0;
80100bc7:	31 d2                	xor    %edx,%edx
80100bc9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    sum += addr[i];
80100bd0:	0f b6 88 00 00 00 80 	movzbl -0x80000000(%eax),%ecx
80100bd7:	83 c0 01             	add    $0x1,%eax
80100bda:	01 ca                	add    %ecx,%edx
  for(i=0; i<len; i++)
80100bdc:	39 f8                	cmp    %edi,%eax
80100bde:	75 f0                	jne    80100bd0 <mpinit+0xb0>
  if(sum((uchar*)conf, conf->length) != 0)
80100be0:	84 d2                	test   %dl,%dl
80100be2:	0f 85 f8 00 00 00    	jne    80100ce0 <mpinit+0x1c0>
  struct mpioapic *ioapic;

  if((conf = mpconfig(&mp)) == 0)
    panic("Expect to run on an SMP");
  ismp = 1;
  lapic = (uint*)conf->lapicaddr;
80100be8:	8b 83 24 00 00 80    	mov    -0x7fffffdc(%ebx),%eax
80100bee:	a3 e4 a8 10 80       	mov    %eax,0x8010a8e4
  for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
80100bf3:	8d 83 2c 00 00 80    	lea    -0x7fffffd4(%ebx),%eax
80100bf9:	0f b7 93 04 00 00 80 	movzwl -0x7ffffffc(%ebx),%edx
  ismp = 1;
80100c00:	bb 01 00 00 00       	mov    $0x1,%ebx
  for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
80100c05:	03 55 e4             	add    -0x1c(%ebp),%edx
80100c08:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
80100c0b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80100c0f:	90                   	nop
80100c10:	39 c2                	cmp    %eax,%edx
80100c12:	76 15                	jbe    80100c29 <mpinit+0x109>
    switch(*p){
80100c14:	0f b6 08             	movzbl (%eax),%ecx
80100c17:	80 f9 02             	cmp    $0x2,%cl
80100c1a:	74 5c                	je     80100c78 <mpinit+0x158>
80100c1c:	77 42                	ja     80100c60 <mpinit+0x140>
80100c1e:	84 c9                	test   %cl,%cl
80100c20:	74 6e                	je     80100c90 <mpinit+0x170>
      p += sizeof(struct mpioapic);
      continue;
    case MPBUS:
    case MPIOINTR:
    case MPLINTR:
      p += 8;
80100c22:	83 c0 08             	add    $0x8,%eax
  for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
80100c25:	39 c2                	cmp    %eax,%edx
80100c27:	77 eb                	ja     80100c14 <mpinit+0xf4>
80100c29:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
    default:
      ismp = 0;
      break;
    }
  }
  if(!ismp)
80100c2c:	85 db                	test   %ebx,%ebx
80100c2e:	0f 84 b9 00 00 00    	je     80100ced <mpinit+0x1cd>
    panic("Didn't find a suitable machine");

  if(mp->imcrp){
80100c34:	80 7e 0c 00          	cmpb   $0x0,0xc(%esi)
80100c38:	74 15                	je     80100c4f <mpinit+0x12f>
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80100c3a:	b8 70 00 00 00       	mov    $0x70,%eax
80100c3f:	ba 22 00 00 00       	mov    $0x22,%edx
80100c44:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80100c45:	ba 23 00 00 00       	mov    $0x23,%edx
80100c4a:	ec                   	in     (%dx),%al
    // Bochs doesn't support IMCR, so this doesn't run on Bochs.
    // But it would on real hardware.
    outb(0x22, 0x70);   // Select IMCR
    outb(0x23, inb(0x23) | 1);  // Mask external interrupts.
80100c4b:	83 c8 01             	or     $0x1,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80100c4e:	ee                   	out    %al,(%dx)
  }
}
80100c4f:	8d 65 f4             	lea    -0xc(%ebp),%esp
80100c52:	5b                   	pop    %ebx
80100c53:	5e                   	pop    %esi
80100c54:	5f                   	pop    %edi
80100c55:	5d                   	pop    %ebp
80100c56:	c3                   	ret    
80100c57:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100c5e:	66 90                	xchg   %ax,%ax
    switch(*p){
80100c60:	83 e9 03             	sub    $0x3,%ecx
80100c63:	80 f9 01             	cmp    $0x1,%cl
80100c66:	76 ba                	jbe    80100c22 <mpinit+0x102>
80100c68:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
80100c6f:	eb 9f                	jmp    80100c10 <mpinit+0xf0>
80100c71:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
      ioapicid = ioapic->apicno;
80100c78:	0f b6 48 01          	movzbl 0x1(%eax),%ecx
      p += sizeof(struct mpioapic);
80100c7c:	83 c0 08             	add    $0x8,%eax
      ioapicid = ioapic->apicno;
80100c7f:	88 0d 00 a9 10 80    	mov    %cl,0x8010a900
      continue;
80100c85:	eb 89                	jmp    80100c10 <mpinit+0xf0>
80100c87:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100c8e:	66 90                	xchg   %ax,%ax
      if(ncpu < NCPU) {
80100c90:	8b 0d a0 ae 10 80    	mov    0x8010aea0,%ecx
80100c96:	83 f9 07             	cmp    $0x7,%ecx
80100c99:	7f 19                	jg     80100cb4 <mpinit+0x194>
        cpus[ncpu].apicid = proc->apicid;  // apicid may differ from ncpu
80100c9b:	69 f9 b0 00 00 00    	imul   $0xb0,%ecx,%edi
80100ca1:	0f b6 58 01          	movzbl 0x1(%eax),%ebx
        ncpu++;
80100ca5:	83 c1 01             	add    $0x1,%ecx
80100ca8:	89 0d a0 ae 10 80    	mov    %ecx,0x8010aea0
        cpus[ncpu].apicid = proc->apicid;  // apicid may differ from ncpu
80100cae:	88 9f 20 a9 10 80    	mov    %bl,-0x7fef56e0(%edi)
      p += sizeof(struct mpproc);
80100cb4:	83 c0 14             	add    $0x14,%eax
      continue;
80100cb7:	e9 54 ff ff ff       	jmp    80100c10 <mpinit+0xf0>
80100cbc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  return mpsearch1(0xF0000, 0x10000);
80100cc0:	ba 00 00 01 00       	mov    $0x10000,%edx
80100cc5:	b8 00 00 0f 00       	mov    $0xf0000,%eax
80100cca:	e8 d1 fd ff ff       	call   80100aa0 <mpsearch1>
80100ccf:	89 c6                	mov    %eax,%esi
  if((mp = mpsearch()) == 0 || mp->physaddr == 0)
80100cd1:	85 c0                	test   %eax,%eax
80100cd3:	0f 85 9b fe ff ff    	jne    80100b74 <mpinit+0x54>
80100cd9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    panic("Expect to run on an SMP");
80100ce0:	83 ec 0c             	sub    $0xc,%esp
80100ce3:	68 cc 72 10 80       	push   $0x801072cc
80100ce8:	e8 d3 0c 00 00       	call   801019c0 <panic>
    panic("Didn't find a suitable machine");
80100ced:	83 ec 0c             	sub    $0xc,%esp
80100cf0:	68 e4 72 10 80       	push   $0x801072e4
80100cf5:	e8 c6 0c 00 00       	call   801019c0 <panic>
80100cfa:	66 90                	xchg   %ax,%ax
80100cfc:	66 90                	xchg   %ax,%ax
80100cfe:	66 90                	xchg   %ax,%ax

80100d00 <install_trans>:
static void
install_trans(void)
{
  int tail;

  for (tail = 0; tail < log.lh.n; tail++) {
80100d00:	8b 0d 08 af 10 80    	mov    0x8010af08,%ecx
80100d06:	85 c9                	test   %ecx,%ecx
80100d08:	0f 8e 8a 00 00 00    	jle    80100d98 <install_trans+0x98>
{
80100d0e:	55                   	push   %ebp
80100d0f:	89 e5                	mov    %esp,%ebp
80100d11:	57                   	push   %edi
  for (tail = 0; tail < log.lh.n; tail++) {
80100d12:	31 ff                	xor    %edi,%edi
{
80100d14:	56                   	push   %esi
80100d15:	53                   	push   %ebx
80100d16:	83 ec 0c             	sub    $0xc,%esp
80100d19:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block
80100d20:	a1 f4 ae 10 80       	mov    0x8010aef4,%eax
80100d25:	83 ec 08             	sub    $0x8,%esp
80100d28:	01 f8                	add    %edi,%eax
80100d2a:	83 c0 01             	add    $0x1,%eax
80100d2d:	50                   	push   %eax
80100d2e:	ff 35 04 af 10 80    	pushl  0x8010af04
80100d34:	e8 57 25 00 00       	call   80103290 <bread>
80100d39:	89 c6                	mov    %eax,%esi
    struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80100d3b:	58                   	pop    %eax
80100d3c:	5a                   	pop    %edx
80100d3d:	ff 34 bd 0c af 10 80 	pushl  -0x7fef50f4(,%edi,4)
80100d44:	ff 35 04 af 10 80    	pushl  0x8010af04
  for (tail = 0; tail < log.lh.n; tail++) {
80100d4a:	83 c7 01             	add    $0x1,%edi
    struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80100d4d:	e8 3e 25 00 00       	call   80103290 <bread>
    memmove(dbuf->data, lbuf->data, BSIZE);  // copy block to dst
80100d52:	83 c4 0c             	add    $0xc,%esp
    struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80100d55:	89 c3                	mov    %eax,%ebx
    memmove(dbuf->data, lbuf->data, BSIZE);  // copy block to dst
80100d57:	8d 46 5c             	lea    0x5c(%esi),%eax
80100d5a:	68 00 02 00 00       	push   $0x200
80100d5f:	50                   	push   %eax
80100d60:	8d 43 5c             	lea    0x5c(%ebx),%eax
80100d63:	50                   	push   %eax
80100d64:	e8 07 45 00 00       	call   80105270 <memmove>
    bwrite(dbuf);  // write dst to disk
80100d69:	89 1c 24             	mov    %ebx,(%esp)
80100d6c:	e8 ff 25 00 00       	call   80103370 <bwrite>
    brelse(lbuf);
80100d71:	89 34 24             	mov    %esi,(%esp)
80100d74:	e8 37 26 00 00       	call   801033b0 <brelse>
    brelse(dbuf);
80100d79:	89 1c 24             	mov    %ebx,(%esp)
80100d7c:	e8 2f 26 00 00       	call   801033b0 <brelse>
  for (tail = 0; tail < log.lh.n; tail++) {
80100d81:	83 c4 10             	add    $0x10,%esp
80100d84:	39 3d 08 af 10 80    	cmp    %edi,0x8010af08
80100d8a:	7f 94                	jg     80100d20 <install_trans+0x20>
  }
}
80100d8c:	8d 65 f4             	lea    -0xc(%ebp),%esp
80100d8f:	5b                   	pop    %ebx
80100d90:	5e                   	pop    %esi
80100d91:	5f                   	pop    %edi
80100d92:	5d                   	pop    %ebp
80100d93:	c3                   	ret    
80100d94:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80100d98:	c3                   	ret    
80100d99:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80100da0 <write_head>:
// Write in-memory log header to disk.
// This is the true point at which the
// current transaction commits.
static void
write_head(void)
{
80100da0:	55                   	push   %ebp
80100da1:	89 e5                	mov    %esp,%ebp
80100da3:	53                   	push   %ebx
80100da4:	83 ec 0c             	sub    $0xc,%esp
  struct buf *buf = bread(log.dev, log.start);
80100da7:	ff 35 f4 ae 10 80    	pushl  0x8010aef4
80100dad:	ff 35 04 af 10 80    	pushl  0x8010af04
80100db3:	e8 d8 24 00 00       	call   80103290 <bread>
  struct logheader *hb = (struct logheader *) (buf->data);
  int i;
  hb->n = log.lh.n;
  for (i = 0; i < log.lh.n; i++) {
80100db8:	83 c4 10             	add    $0x10,%esp
  struct buf *buf = bread(log.dev, log.start);
80100dbb:	89 c3                	mov    %eax,%ebx
  hb->n = log.lh.n;
80100dbd:	a1 08 af 10 80       	mov    0x8010af08,%eax
80100dc2:	89 43 5c             	mov    %eax,0x5c(%ebx)
  for (i = 0; i < log.lh.n; i++) {
80100dc5:	85 c0                	test   %eax,%eax
80100dc7:	7e 19                	jle    80100de2 <write_head+0x42>
80100dc9:	31 d2                	xor    %edx,%edx
80100dcb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80100dcf:	90                   	nop
    hb->block[i] = log.lh.block[i];
80100dd0:	8b 0c 95 0c af 10 80 	mov    -0x7fef50f4(,%edx,4),%ecx
80100dd7:	89 4c 93 60          	mov    %ecx,0x60(%ebx,%edx,4)
  for (i = 0; i < log.lh.n; i++) {
80100ddb:	83 c2 01             	add    $0x1,%edx
80100dde:	39 d0                	cmp    %edx,%eax
80100de0:	75 ee                	jne    80100dd0 <write_head+0x30>
  }
  bwrite(buf);
80100de2:	83 ec 0c             	sub    $0xc,%esp
80100de5:	53                   	push   %ebx
80100de6:	e8 85 25 00 00       	call   80103370 <bwrite>
  brelse(buf);
80100deb:	89 1c 24             	mov    %ebx,(%esp)
80100dee:	e8 bd 25 00 00       	call   801033b0 <brelse>
}
80100df3:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80100df6:	83 c4 10             	add    $0x10,%esp
80100df9:	c9                   	leave  
80100dfa:	c3                   	ret    
80100dfb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80100dff:	90                   	nop

80100e00 <initlog>:
{
80100e00:	f3 0f 1e fb          	endbr32 
80100e04:	55                   	push   %ebp
80100e05:	89 e5                	mov    %esp,%ebp
80100e07:	53                   	push   %ebx
80100e08:	83 ec 2c             	sub    $0x2c,%esp
80100e0b:	8b 5d 08             	mov    0x8(%ebp),%ebx
  initlock(&log.lock, "log");
80100e0e:	68 03 73 10 80       	push   $0x80107303
80100e13:	68 c0 ae 10 80       	push   $0x8010aec0
80100e18:	e8 f3 f4 ff ff       	call   80100310 <initlock>
  readsb(dev, &sb);
80100e1d:	58                   	pop    %eax
80100e1e:	8d 45 dc             	lea    -0x24(%ebp),%eax
80100e21:	5a                   	pop    %edx
80100e22:	50                   	push   %eax
80100e23:	53                   	push   %ebx
80100e24:	e8 67 18 00 00       	call   80102690 <readsb>
  log.start = sb.logstart;
80100e29:	8b 45 ec             	mov    -0x14(%ebp),%eax
  struct buf *buf = bread(log.dev, log.start);
80100e2c:	59                   	pop    %ecx
  log.dev = dev;
80100e2d:	89 1d 04 af 10 80    	mov    %ebx,0x8010af04
  log.size = sb.nlog;
80100e33:	8b 55 e8             	mov    -0x18(%ebp),%edx
  log.start = sb.logstart;
80100e36:	a3 f4 ae 10 80       	mov    %eax,0x8010aef4
  log.size = sb.nlog;
80100e3b:	89 15 f8 ae 10 80    	mov    %edx,0x8010aef8
  struct buf *buf = bread(log.dev, log.start);
80100e41:	5a                   	pop    %edx
80100e42:	50                   	push   %eax
80100e43:	53                   	push   %ebx
80100e44:	e8 47 24 00 00       	call   80103290 <bread>
  for (i = 0; i < log.lh.n; i++) {
80100e49:	83 c4 10             	add    $0x10,%esp
  log.lh.n = lh->n;
80100e4c:	8b 48 5c             	mov    0x5c(%eax),%ecx
80100e4f:	89 0d 08 af 10 80    	mov    %ecx,0x8010af08
  for (i = 0; i < log.lh.n; i++) {
80100e55:	85 c9                	test   %ecx,%ecx
80100e57:	7e 19                	jle    80100e72 <initlog+0x72>
80100e59:	31 d2                	xor    %edx,%edx
80100e5b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80100e5f:	90                   	nop
    log.lh.block[i] = lh->block[i];
80100e60:	8b 5c 90 60          	mov    0x60(%eax,%edx,4),%ebx
80100e64:	89 1c 95 0c af 10 80 	mov    %ebx,-0x7fef50f4(,%edx,4)
  for (i = 0; i < log.lh.n; i++) {
80100e6b:	83 c2 01             	add    $0x1,%edx
80100e6e:	39 d1                	cmp    %edx,%ecx
80100e70:	75 ee                	jne    80100e60 <initlog+0x60>
  brelse(buf);
80100e72:	83 ec 0c             	sub    $0xc,%esp
80100e75:	50                   	push   %eax
80100e76:	e8 35 25 00 00       	call   801033b0 <brelse>

static void
recover_from_log(void)
{
  read_head();
  install_trans(); // if committed, copy from log to disk
80100e7b:	e8 80 fe ff ff       	call   80100d00 <install_trans>
  log.lh.n = 0;
80100e80:	c7 05 08 af 10 80 00 	movl   $0x0,0x8010af08
80100e87:	00 00 00 
  write_head(); // clear the log
80100e8a:	e8 11 ff ff ff       	call   80100da0 <write_head>
}
80100e8f:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80100e92:	83 c4 10             	add    $0x10,%esp
80100e95:	c9                   	leave  
80100e96:	c3                   	ret    
80100e97:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100e9e:	66 90                	xchg   %ax,%ax

80100ea0 <begin_op>:
}

// called at the start of each FS system call.
void
begin_op(void)
{
80100ea0:	f3 0f 1e fb          	endbr32 
80100ea4:	55                   	push   %ebp
80100ea5:	89 e5                	mov    %esp,%ebp
80100ea7:	83 ec 14             	sub    $0x14,%esp
  acquire(&log.lock);
80100eaa:	68 c0 ae 10 80       	push   $0x8010aec0
80100eaf:	e8 dc f5 ff ff       	call   80100490 <acquire>
80100eb4:	83 c4 10             	add    $0x10,%esp
80100eb7:	eb 1c                	jmp    80100ed5 <begin_op+0x35>
80100eb9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  while(1){
    if(log.committing){
      sleep(&log, &log.lock);
80100ec0:	83 ec 08             	sub    $0x8,%esp
80100ec3:	68 c0 ae 10 80       	push   $0x8010aec0
80100ec8:	68 c0 ae 10 80       	push   $0x8010aec0
80100ecd:	e8 8e 30 00 00       	call   80103f60 <sleep>
80100ed2:	83 c4 10             	add    $0x10,%esp
    if(log.committing){
80100ed5:	a1 00 af 10 80       	mov    0x8010af00,%eax
80100eda:	85 c0                	test   %eax,%eax
80100edc:	75 e2                	jne    80100ec0 <begin_op+0x20>
    } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){
80100ede:	a1 fc ae 10 80       	mov    0x8010aefc,%eax
80100ee3:	8b 15 08 af 10 80    	mov    0x8010af08,%edx
80100ee9:	83 c0 01             	add    $0x1,%eax
80100eec:	8d 0c 80             	lea    (%eax,%eax,4),%ecx
80100eef:	8d 14 4a             	lea    (%edx,%ecx,2),%edx
80100ef2:	83 fa 1e             	cmp    $0x1e,%edx
80100ef5:	7f c9                	jg     80100ec0 <begin_op+0x20>
      // this op might exhaust log space; wait for commit.
      sleep(&log, &log.lock);
    } else {
      log.outstanding += 1;
      release(&log.lock);
80100ef7:	83 ec 0c             	sub    $0xc,%esp
      log.outstanding += 1;
80100efa:	a3 fc ae 10 80       	mov    %eax,0x8010aefc
      release(&log.lock);
80100eff:	68 c0 ae 10 80       	push   $0x8010aec0
80100f04:	e8 47 f6 ff ff       	call   80100550 <release>
      break;
    }
  }
}
80100f09:	83 c4 10             	add    $0x10,%esp
80100f0c:	c9                   	leave  
80100f0d:	c3                   	ret    
80100f0e:	66 90                	xchg   %ax,%ax

80100f10 <end_op>:

// called at the end of each FS system call.
// commits if this was the last outstanding operation.
void
end_op(void)
{
80100f10:	f3 0f 1e fb          	endbr32 
80100f14:	55                   	push   %ebp
80100f15:	89 e5                	mov    %esp,%ebp
80100f17:	57                   	push   %edi
80100f18:	56                   	push   %esi
80100f19:	53                   	push   %ebx
80100f1a:	83 ec 18             	sub    $0x18,%esp
  int do_commit = 0;

  acquire(&log.lock);
80100f1d:	68 c0 ae 10 80       	push   $0x8010aec0
80100f22:	e8 69 f5 ff ff       	call   80100490 <acquire>
  log.outstanding -= 1;
80100f27:	a1 fc ae 10 80       	mov    0x8010aefc,%eax
  if(log.committing)
80100f2c:	8b 35 00 af 10 80    	mov    0x8010af00,%esi
80100f32:	83 c4 10             	add    $0x10,%esp
  log.outstanding -= 1;
80100f35:	8d 58 ff             	lea    -0x1(%eax),%ebx
80100f38:	89 1d fc ae 10 80    	mov    %ebx,0x8010aefc
  if(log.committing)
80100f3e:	85 f6                	test   %esi,%esi
80100f40:	0f 85 1e 01 00 00    	jne    80101064 <end_op+0x154>
    panic("log.committing");
  if(log.outstanding == 0){
80100f46:	85 db                	test   %ebx,%ebx
80100f48:	0f 85 f2 00 00 00    	jne    80101040 <end_op+0x130>
    do_commit = 1;
    log.committing = 1;
80100f4e:	c7 05 00 af 10 80 01 	movl   $0x1,0x8010af00
80100f55:	00 00 00 
    // begin_op() may be waiting for log space,
    // and decrementing log.outstanding has decreased
    // the amount of reserved space.
    wakeup(&log);
  }
  release(&log.lock);
80100f58:	83 ec 0c             	sub    $0xc,%esp
80100f5b:	68 c0 ae 10 80       	push   $0x8010aec0
80100f60:	e8 eb f5 ff ff       	call   80100550 <release>
}

static void
commit()
{
  if (log.lh.n > 0) {
80100f65:	8b 0d 08 af 10 80    	mov    0x8010af08,%ecx
80100f6b:	83 c4 10             	add    $0x10,%esp
80100f6e:	85 c9                	test   %ecx,%ecx
80100f70:	7f 3e                	jg     80100fb0 <end_op+0xa0>
    acquire(&log.lock);
80100f72:	83 ec 0c             	sub    $0xc,%esp
80100f75:	68 c0 ae 10 80       	push   $0x8010aec0
80100f7a:	e8 11 f5 ff ff       	call   80100490 <acquire>
    wakeup(&log);
80100f7f:	c7 04 24 c0 ae 10 80 	movl   $0x8010aec0,(%esp)
    log.committing = 0;
80100f86:	c7 05 00 af 10 80 00 	movl   $0x0,0x8010af00
80100f8d:	00 00 00 
    wakeup(&log);
80100f90:	e8 8b 31 00 00       	call   80104120 <wakeup>
    release(&log.lock);
80100f95:	c7 04 24 c0 ae 10 80 	movl   $0x8010aec0,(%esp)
80100f9c:	e8 af f5 ff ff       	call   80100550 <release>
80100fa1:	83 c4 10             	add    $0x10,%esp
}
80100fa4:	8d 65 f4             	lea    -0xc(%ebp),%esp
80100fa7:	5b                   	pop    %ebx
80100fa8:	5e                   	pop    %esi
80100fa9:	5f                   	pop    %edi
80100faa:	5d                   	pop    %ebp
80100fab:	c3                   	ret    
80100fac:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    struct buf *to = bread(log.dev, log.start+tail+1); // log block
80100fb0:	a1 f4 ae 10 80       	mov    0x8010aef4,%eax
80100fb5:	83 ec 08             	sub    $0x8,%esp
80100fb8:	01 d8                	add    %ebx,%eax
80100fba:	83 c0 01             	add    $0x1,%eax
80100fbd:	50                   	push   %eax
80100fbe:	ff 35 04 af 10 80    	pushl  0x8010af04
80100fc4:	e8 c7 22 00 00       	call   80103290 <bread>
80100fc9:	89 c6                	mov    %eax,%esi
    struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80100fcb:	58                   	pop    %eax
80100fcc:	5a                   	pop    %edx
80100fcd:	ff 34 9d 0c af 10 80 	pushl  -0x7fef50f4(,%ebx,4)
80100fd4:	ff 35 04 af 10 80    	pushl  0x8010af04
  for (tail = 0; tail < log.lh.n; tail++) {
80100fda:	83 c3 01             	add    $0x1,%ebx
    struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80100fdd:	e8 ae 22 00 00       	call   80103290 <bread>
    memmove(to->data, from->data, BSIZE);
80100fe2:	83 c4 0c             	add    $0xc,%esp
    struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80100fe5:	89 c7                	mov    %eax,%edi
    memmove(to->data, from->data, BSIZE);
80100fe7:	8d 40 5c             	lea    0x5c(%eax),%eax
80100fea:	68 00 02 00 00       	push   $0x200
80100fef:	50                   	push   %eax
80100ff0:	8d 46 5c             	lea    0x5c(%esi),%eax
80100ff3:	50                   	push   %eax
80100ff4:	e8 77 42 00 00       	call   80105270 <memmove>
    bwrite(to);  // write the log
80100ff9:	89 34 24             	mov    %esi,(%esp)
80100ffc:	e8 6f 23 00 00       	call   80103370 <bwrite>
    brelse(from);
80101001:	89 3c 24             	mov    %edi,(%esp)
80101004:	e8 a7 23 00 00       	call   801033b0 <brelse>
    brelse(to);
80101009:	89 34 24             	mov    %esi,(%esp)
8010100c:	e8 9f 23 00 00       	call   801033b0 <brelse>
  for (tail = 0; tail < log.lh.n; tail++) {
80101011:	83 c4 10             	add    $0x10,%esp
80101014:	3b 1d 08 af 10 80    	cmp    0x8010af08,%ebx
8010101a:	7c 94                	jl     80100fb0 <end_op+0xa0>
    write_log();     // Write modified blocks from cache to log
    write_head();    // Write header to disk -- the real commit
8010101c:	e8 7f fd ff ff       	call   80100da0 <write_head>
    install_trans(); // Now install writes to home locations
80101021:	e8 da fc ff ff       	call   80100d00 <install_trans>
    log.lh.n = 0;
80101026:	c7 05 08 af 10 80 00 	movl   $0x0,0x8010af08
8010102d:	00 00 00 
    write_head();    // Erase the transaction from the log
80101030:	e8 6b fd ff ff       	call   80100da0 <write_head>
80101035:	e9 38 ff ff ff       	jmp    80100f72 <end_op+0x62>
8010103a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    wakeup(&log);
80101040:	83 ec 0c             	sub    $0xc,%esp
80101043:	68 c0 ae 10 80       	push   $0x8010aec0
80101048:	e8 d3 30 00 00       	call   80104120 <wakeup>
  release(&log.lock);
8010104d:	c7 04 24 c0 ae 10 80 	movl   $0x8010aec0,(%esp)
80101054:	e8 f7 f4 ff ff       	call   80100550 <release>
80101059:	83 c4 10             	add    $0x10,%esp
}
8010105c:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010105f:	5b                   	pop    %ebx
80101060:	5e                   	pop    %esi
80101061:	5f                   	pop    %edi
80101062:	5d                   	pop    %ebp
80101063:	c3                   	ret    
    panic("log.committing");
80101064:	83 ec 0c             	sub    $0xc,%esp
80101067:	68 07 73 10 80       	push   $0x80107307
8010106c:	e8 4f 09 00 00       	call   801019c0 <panic>
80101071:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80101078:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010107f:	90                   	nop

80101080 <log_write>:
//   modify bp->data[]
//   log_write(bp)
//   brelse(bp)
void
log_write(struct buf *b)
{
80101080:	f3 0f 1e fb          	endbr32 
80101084:	55                   	push   %ebp
80101085:	89 e5                	mov    %esp,%ebp
80101087:	53                   	push   %ebx
80101088:	83 ec 04             	sub    $0x4,%esp
  int i;

  if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
8010108b:	8b 15 08 af 10 80    	mov    0x8010af08,%edx
{
80101091:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
80101094:	83 fa 1d             	cmp    $0x1d,%edx
80101097:	0f 8f 91 00 00 00    	jg     8010112e <log_write+0xae>
8010109d:	a1 f8 ae 10 80       	mov    0x8010aef8,%eax
801010a2:	83 e8 01             	sub    $0x1,%eax
801010a5:	39 c2                	cmp    %eax,%edx
801010a7:	0f 8d 81 00 00 00    	jge    8010112e <log_write+0xae>
    panic("too big a transaction");
  if (log.outstanding < 1)
801010ad:	a1 fc ae 10 80       	mov    0x8010aefc,%eax
801010b2:	85 c0                	test   %eax,%eax
801010b4:	0f 8e 81 00 00 00    	jle    8010113b <log_write+0xbb>
    panic("log_write outside of trans");

  acquire(&log.lock);
801010ba:	83 ec 0c             	sub    $0xc,%esp
801010bd:	68 c0 ae 10 80       	push   $0x8010aec0
801010c2:	e8 c9 f3 ff ff       	call   80100490 <acquire>
  for (i = 0; i < log.lh.n; i++) {
801010c7:	8b 15 08 af 10 80    	mov    0x8010af08,%edx
801010cd:	83 c4 10             	add    $0x10,%esp
801010d0:	85 d2                	test   %edx,%edx
801010d2:	7e 4e                	jle    80101122 <log_write+0xa2>
    if (log.lh.block[i] == b->blockno)   // log absorbtion
801010d4:	8b 4b 08             	mov    0x8(%ebx),%ecx
  for (i = 0; i < log.lh.n; i++) {
801010d7:	31 c0                	xor    %eax,%eax
801010d9:	eb 0c                	jmp    801010e7 <log_write+0x67>
801010db:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801010df:	90                   	nop
801010e0:	83 c0 01             	add    $0x1,%eax
801010e3:	39 c2                	cmp    %eax,%edx
801010e5:	74 29                	je     80101110 <log_write+0x90>
    if (log.lh.block[i] == b->blockno)   // log absorbtion
801010e7:	39 0c 85 0c af 10 80 	cmp    %ecx,-0x7fef50f4(,%eax,4)
801010ee:	75 f0                	jne    801010e0 <log_write+0x60>
      break;
  }
  log.lh.block[i] = b->blockno;
801010f0:	89 0c 85 0c af 10 80 	mov    %ecx,-0x7fef50f4(,%eax,4)
  if (i == log.lh.n)
    log.lh.n++;
  b->flags |= B_DIRTY; // prevent eviction
801010f7:	83 0b 04             	orl    $0x4,(%ebx)
  release(&log.lock);
}
801010fa:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  release(&log.lock);
801010fd:	c7 45 08 c0 ae 10 80 	movl   $0x8010aec0,0x8(%ebp)
}
80101104:	c9                   	leave  
  release(&log.lock);
80101105:	e9 46 f4 ff ff       	jmp    80100550 <release>
8010110a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  log.lh.block[i] = b->blockno;
80101110:	89 0c 95 0c af 10 80 	mov    %ecx,-0x7fef50f4(,%edx,4)
    log.lh.n++;
80101117:	83 c2 01             	add    $0x1,%edx
8010111a:	89 15 08 af 10 80    	mov    %edx,0x8010af08
80101120:	eb d5                	jmp    801010f7 <log_write+0x77>
  log.lh.block[i] = b->blockno;
80101122:	8b 43 08             	mov    0x8(%ebx),%eax
80101125:	a3 0c af 10 80       	mov    %eax,0x8010af0c
  if (i == log.lh.n)
8010112a:	75 cb                	jne    801010f7 <log_write+0x77>
8010112c:	eb e9                	jmp    80101117 <log_write+0x97>
    panic("too big a transaction");
8010112e:	83 ec 0c             	sub    $0xc,%esp
80101131:	68 16 73 10 80       	push   $0x80107316
80101136:	e8 85 08 00 00       	call   801019c0 <panic>
    panic("log_write outside of trans");
8010113b:	83 ec 0c             	sub    $0xc,%esp
8010113e:	68 2c 73 10 80       	push   $0x8010732c
80101143:	e8 78 08 00 00       	call   801019c0 <panic>
80101148:	66 90                	xchg   %ax,%ax
8010114a:	66 90                	xchg   %ax,%ax
8010114c:	66 90                	xchg   %ax,%ax
8010114e:	66 90                	xchg   %ax,%ax

80101150 <fileinit>:
  struct file file[NFILE];
} ftable;

void
fileinit(void)
{
80101150:	f3 0f 1e fb          	endbr32 
80101154:	55                   	push   %ebp
80101155:	89 e5                	mov    %esp,%ebp
80101157:	83 ec 10             	sub    $0x10,%esp
  initlock(&ftable.lock, "ftable");
8010115a:	68 47 73 10 80       	push   $0x80107347
8010115f:	68 a0 af 10 80       	push   $0x8010afa0
80101164:	e8 a7 f1 ff ff       	call   80100310 <initlock>
}
80101169:	83 c4 10             	add    $0x10,%esp
8010116c:	c9                   	leave  
8010116d:	c3                   	ret    
8010116e:	66 90                	xchg   %ax,%ax

80101170 <filealloc>:

// Allocate a file structure.
struct file*
filealloc(void)
{
80101170:	f3 0f 1e fb          	endbr32 
80101174:	55                   	push   %ebp
80101175:	89 e5                	mov    %esp,%ebp
80101177:	53                   	push   %ebx
  struct file *f;

  acquire(&ftable.lock);
  for(f = ftable.file; f < ftable.file + NFILE; f++){
80101178:	bb d4 af 10 80       	mov    $0x8010afd4,%ebx
{
8010117d:	83 ec 10             	sub    $0x10,%esp
  acquire(&ftable.lock);
80101180:	68 a0 af 10 80       	push   $0x8010afa0
80101185:	e8 06 f3 ff ff       	call   80100490 <acquire>
8010118a:	83 c4 10             	add    $0x10,%esp
8010118d:	eb 0c                	jmp    8010119b <filealloc+0x2b>
8010118f:	90                   	nop
  for(f = ftable.file; f < ftable.file + NFILE; f++){
80101190:	83 c3 18             	add    $0x18,%ebx
80101193:	81 fb 34 b9 10 80    	cmp    $0x8010b934,%ebx
80101199:	74 25                	je     801011c0 <filealloc+0x50>
    if(f->ref == 0){
8010119b:	8b 43 04             	mov    0x4(%ebx),%eax
8010119e:	85 c0                	test   %eax,%eax
801011a0:	75 ee                	jne    80101190 <filealloc+0x20>
      f->ref = 1;
      release(&ftable.lock);
801011a2:	83 ec 0c             	sub    $0xc,%esp
      f->ref = 1;
801011a5:	c7 43 04 01 00 00 00 	movl   $0x1,0x4(%ebx)
      release(&ftable.lock);
801011ac:	68 a0 af 10 80       	push   $0x8010afa0
801011b1:	e8 9a f3 ff ff       	call   80100550 <release>
      return f;
    }
  }
  release(&ftable.lock);
  return 0;
}
801011b6:	89 d8                	mov    %ebx,%eax
      return f;
801011b8:	83 c4 10             	add    $0x10,%esp
}
801011bb:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801011be:	c9                   	leave  
801011bf:	c3                   	ret    
  release(&ftable.lock);
801011c0:	83 ec 0c             	sub    $0xc,%esp
  return 0;
801011c3:	31 db                	xor    %ebx,%ebx
  release(&ftable.lock);
801011c5:	68 a0 af 10 80       	push   $0x8010afa0
801011ca:	e8 81 f3 ff ff       	call   80100550 <release>
}
801011cf:	89 d8                	mov    %ebx,%eax
  return 0;
801011d1:	83 c4 10             	add    $0x10,%esp
}
801011d4:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801011d7:	c9                   	leave  
801011d8:	c3                   	ret    
801011d9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

801011e0 <filedup>:

// Increment ref count for file f.
struct file*
filedup(struct file *f)
{
801011e0:	f3 0f 1e fb          	endbr32 
801011e4:	55                   	push   %ebp
801011e5:	89 e5                	mov    %esp,%ebp
801011e7:	53                   	push   %ebx
801011e8:	83 ec 10             	sub    $0x10,%esp
801011eb:	8b 5d 08             	mov    0x8(%ebp),%ebx
  acquire(&ftable.lock);
801011ee:	68 a0 af 10 80       	push   $0x8010afa0
801011f3:	e8 98 f2 ff ff       	call   80100490 <acquire>
  if(f->ref < 1)
801011f8:	8b 43 04             	mov    0x4(%ebx),%eax
801011fb:	83 c4 10             	add    $0x10,%esp
801011fe:	85 c0                	test   %eax,%eax
80101200:	7e 1a                	jle    8010121c <filedup+0x3c>
    panic("filedup");
  f->ref++;
80101202:	83 c0 01             	add    $0x1,%eax
  release(&ftable.lock);
80101205:	83 ec 0c             	sub    $0xc,%esp
  f->ref++;
80101208:	89 43 04             	mov    %eax,0x4(%ebx)
  release(&ftable.lock);
8010120b:	68 a0 af 10 80       	push   $0x8010afa0
80101210:	e8 3b f3 ff ff       	call   80100550 <release>
  return f;
}
80101215:	89 d8                	mov    %ebx,%eax
80101217:	8b 5d fc             	mov    -0x4(%ebp),%ebx
8010121a:	c9                   	leave  
8010121b:	c3                   	ret    
    panic("filedup");
8010121c:	83 ec 0c             	sub    $0xc,%esp
8010121f:	68 4e 73 10 80       	push   $0x8010734e
80101224:	e8 97 07 00 00       	call   801019c0 <panic>
80101229:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80101230 <fileclose>:

// Close file f.  (Decrement ref count, close when reaches 0.)
void
fileclose(struct file *f)
{
80101230:	f3 0f 1e fb          	endbr32 
80101234:	55                   	push   %ebp
80101235:	89 e5                	mov    %esp,%ebp
80101237:	57                   	push   %edi
80101238:	56                   	push   %esi
80101239:	53                   	push   %ebx
8010123a:	83 ec 28             	sub    $0x28,%esp
8010123d:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct file ff;

  acquire(&ftable.lock);
80101240:	68 a0 af 10 80       	push   $0x8010afa0
80101245:	e8 46 f2 ff ff       	call   80100490 <acquire>
  if(f->ref < 1)
8010124a:	8b 53 04             	mov    0x4(%ebx),%edx
8010124d:	83 c4 10             	add    $0x10,%esp
80101250:	85 d2                	test   %edx,%edx
80101252:	0f 8e a1 00 00 00    	jle    801012f9 <fileclose+0xc9>
    panic("fileclose");
  if(--f->ref > 0){
80101258:	83 ea 01             	sub    $0x1,%edx
8010125b:	89 53 04             	mov    %edx,0x4(%ebx)
8010125e:	75 40                	jne    801012a0 <fileclose+0x70>
    release(&ftable.lock);
    return;
  }
  ff = *f;
80101260:	0f b6 43 09          	movzbl 0x9(%ebx),%eax
  f->ref = 0;
  f->type = FD_NONE;
  release(&ftable.lock);
80101264:	83 ec 0c             	sub    $0xc,%esp
  ff = *f;
80101267:	8b 3b                	mov    (%ebx),%edi
  f->type = FD_NONE;
80101269:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  ff = *f;
8010126f:	8b 73 0c             	mov    0xc(%ebx),%esi
80101272:	88 45 e7             	mov    %al,-0x19(%ebp)
80101275:	8b 43 10             	mov    0x10(%ebx),%eax
  release(&ftable.lock);
80101278:	68 a0 af 10 80       	push   $0x8010afa0
  ff = *f;
8010127d:	89 45 e0             	mov    %eax,-0x20(%ebp)
  release(&ftable.lock);
80101280:	e8 cb f2 ff ff       	call   80100550 <release>

  if(ff.type == FD_PIPE)
80101285:	83 c4 10             	add    $0x10,%esp
80101288:	83 ff 01             	cmp    $0x1,%edi
8010128b:	74 53                	je     801012e0 <fileclose+0xb0>
    pipeclose(ff.pipe, ff.writable);
  else if(ff.type == FD_INODE){
8010128d:	83 ff 02             	cmp    $0x2,%edi
80101290:	74 26                	je     801012b8 <fileclose+0x88>
    begin_op();
    iput(ff.ip);
    end_op();
  }
}
80101292:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101295:	5b                   	pop    %ebx
80101296:	5e                   	pop    %esi
80101297:	5f                   	pop    %edi
80101298:	5d                   	pop    %ebp
80101299:	c3                   	ret    
8010129a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    release(&ftable.lock);
801012a0:	c7 45 08 a0 af 10 80 	movl   $0x8010afa0,0x8(%ebp)
}
801012a7:	8d 65 f4             	lea    -0xc(%ebp),%esp
801012aa:	5b                   	pop    %ebx
801012ab:	5e                   	pop    %esi
801012ac:	5f                   	pop    %edi
801012ad:	5d                   	pop    %ebp
    release(&ftable.lock);
801012ae:	e9 9d f2 ff ff       	jmp    80100550 <release>
801012b3:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801012b7:	90                   	nop
    begin_op();
801012b8:	e8 e3 fb ff ff       	call   80100ea0 <begin_op>
    iput(ff.ip);
801012bd:	83 ec 0c             	sub    $0xc,%esp
801012c0:	ff 75 e0             	pushl  -0x20(%ebp)
801012c3:	e8 58 17 00 00       	call   80102a20 <iput>
    end_op();
801012c8:	83 c4 10             	add    $0x10,%esp
}
801012cb:	8d 65 f4             	lea    -0xc(%ebp),%esp
801012ce:	5b                   	pop    %ebx
801012cf:	5e                   	pop    %esi
801012d0:	5f                   	pop    %edi
801012d1:	5d                   	pop    %ebp
    end_op();
801012d2:	e9 39 fc ff ff       	jmp    80100f10 <end_op>
801012d7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801012de:	66 90                	xchg   %ax,%ax
    pipeclose(ff.pipe, ff.writable);
801012e0:	0f be 5d e7          	movsbl -0x19(%ebp),%ebx
801012e4:	83 ec 08             	sub    $0x8,%esp
801012e7:	53                   	push   %ebx
801012e8:	56                   	push   %esi
801012e9:	e8 42 03 00 00       	call   80101630 <pipeclose>
801012ee:	83 c4 10             	add    $0x10,%esp
}
801012f1:	8d 65 f4             	lea    -0xc(%ebp),%esp
801012f4:	5b                   	pop    %ebx
801012f5:	5e                   	pop    %esi
801012f6:	5f                   	pop    %edi
801012f7:	5d                   	pop    %ebp
801012f8:	c3                   	ret    
    panic("fileclose");
801012f9:	83 ec 0c             	sub    $0xc,%esp
801012fc:	68 56 73 10 80       	push   $0x80107356
80101301:	e8 ba 06 00 00       	call   801019c0 <panic>
80101306:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010130d:	8d 76 00             	lea    0x0(%esi),%esi

80101310 <filestat>:

// Get metadata about file f.
int
filestat(struct file *f, struct stat *st)
{
80101310:	f3 0f 1e fb          	endbr32 
80101314:	55                   	push   %ebp
80101315:	89 e5                	mov    %esp,%ebp
80101317:	53                   	push   %ebx
80101318:	83 ec 04             	sub    $0x4,%esp
8010131b:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if(f->type == FD_INODE){
8010131e:	83 3b 02             	cmpl   $0x2,(%ebx)
80101321:	75 2d                	jne    80101350 <filestat+0x40>
    ilock(f->ip);
80101323:	83 ec 0c             	sub    $0xc,%esp
80101326:	ff 73 10             	pushl  0x10(%ebx)
80101329:	e8 c2 15 00 00       	call   801028f0 <ilock>
    stati(f->ip, st);
8010132e:	58                   	pop    %eax
8010132f:	5a                   	pop    %edx
80101330:	ff 75 0c             	pushl  0xc(%ebp)
80101333:	ff 73 10             	pushl  0x10(%ebx)
80101336:	e8 85 18 00 00       	call   80102bc0 <stati>
    iunlock(f->ip);
8010133b:	59                   	pop    %ecx
8010133c:	ff 73 10             	pushl  0x10(%ebx)
8010133f:	e8 8c 16 00 00       	call   801029d0 <iunlock>
    return 0;
  }
  return -1;
}
80101344:	8b 5d fc             	mov    -0x4(%ebp),%ebx
    return 0;
80101347:	83 c4 10             	add    $0x10,%esp
8010134a:	31 c0                	xor    %eax,%eax
}
8010134c:	c9                   	leave  
8010134d:	c3                   	ret    
8010134e:	66 90                	xchg   %ax,%ax
80101350:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  return -1;
80101353:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80101358:	c9                   	leave  
80101359:	c3                   	ret    
8010135a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80101360 <fileread>:

// Read from file f.
int
fileread(struct file *f, char *addr, int n)
{
80101360:	f3 0f 1e fb          	endbr32 
80101364:	55                   	push   %ebp
80101365:	89 e5                	mov    %esp,%ebp
80101367:	57                   	push   %edi
80101368:	56                   	push   %esi
80101369:	53                   	push   %ebx
8010136a:	83 ec 0c             	sub    $0xc,%esp
8010136d:	8b 5d 08             	mov    0x8(%ebp),%ebx
80101370:	8b 75 0c             	mov    0xc(%ebp),%esi
80101373:	8b 7d 10             	mov    0x10(%ebp),%edi
  int r;

  if(f->readable == 0)
80101376:	80 7b 08 00          	cmpb   $0x0,0x8(%ebx)
8010137a:	74 64                	je     801013e0 <fileread+0x80>
    return -1;
  if(f->type == FD_PIPE)
8010137c:	8b 03                	mov    (%ebx),%eax
8010137e:	83 f8 01             	cmp    $0x1,%eax
80101381:	74 45                	je     801013c8 <fileread+0x68>
    return piperead(f->pipe, addr, n);
  if(f->type == FD_INODE){
80101383:	83 f8 02             	cmp    $0x2,%eax
80101386:	75 5f                	jne    801013e7 <fileread+0x87>
    ilock(f->ip);
80101388:	83 ec 0c             	sub    $0xc,%esp
8010138b:	ff 73 10             	pushl  0x10(%ebx)
8010138e:	e8 5d 15 00 00       	call   801028f0 <ilock>
    if((r = readi(f->ip, addr, f->off, n)) > 0)
80101393:	57                   	push   %edi
80101394:	ff 73 14             	pushl  0x14(%ebx)
80101397:	56                   	push   %esi
80101398:	ff 73 10             	pushl  0x10(%ebx)
8010139b:	e8 50 18 00 00       	call   80102bf0 <readi>
801013a0:	83 c4 20             	add    $0x20,%esp
801013a3:	89 c6                	mov    %eax,%esi
801013a5:	85 c0                	test   %eax,%eax
801013a7:	7e 03                	jle    801013ac <fileread+0x4c>
      f->off += r;
801013a9:	01 43 14             	add    %eax,0x14(%ebx)
    iunlock(f->ip);
801013ac:	83 ec 0c             	sub    $0xc,%esp
801013af:	ff 73 10             	pushl  0x10(%ebx)
801013b2:	e8 19 16 00 00       	call   801029d0 <iunlock>
    return r;
801013b7:	83 c4 10             	add    $0x10,%esp
  }
  panic("fileread");
}
801013ba:	8d 65 f4             	lea    -0xc(%ebp),%esp
801013bd:	89 f0                	mov    %esi,%eax
801013bf:	5b                   	pop    %ebx
801013c0:	5e                   	pop    %esi
801013c1:	5f                   	pop    %edi
801013c2:	5d                   	pop    %ebp
801013c3:	c3                   	ret    
801013c4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    return piperead(f->pipe, addr, n);
801013c8:	8b 43 0c             	mov    0xc(%ebx),%eax
801013cb:	89 45 08             	mov    %eax,0x8(%ebp)
}
801013ce:	8d 65 f4             	lea    -0xc(%ebp),%esp
801013d1:	5b                   	pop    %ebx
801013d2:	5e                   	pop    %esi
801013d3:	5f                   	pop    %edi
801013d4:	5d                   	pop    %ebp
    return piperead(f->pipe, addr, n);
801013d5:	e9 f6 03 00 00       	jmp    801017d0 <piperead>
801013da:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    return -1;
801013e0:	be ff ff ff ff       	mov    $0xffffffff,%esi
801013e5:	eb d3                	jmp    801013ba <fileread+0x5a>
  panic("fileread");
801013e7:	83 ec 0c             	sub    $0xc,%esp
801013ea:	68 60 73 10 80       	push   $0x80107360
801013ef:	e8 cc 05 00 00       	call   801019c0 <panic>
801013f4:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801013fb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801013ff:	90                   	nop

80101400 <filewrite>:

//PAGEBREAK!
// Write to file f.
int
filewrite(struct file *f, char *addr, int n)
{
80101400:	f3 0f 1e fb          	endbr32 
80101404:	55                   	push   %ebp
80101405:	89 e5                	mov    %esp,%ebp
80101407:	57                   	push   %edi
80101408:	56                   	push   %esi
80101409:	53                   	push   %ebx
8010140a:	83 ec 1c             	sub    $0x1c,%esp
8010140d:	8b 45 0c             	mov    0xc(%ebp),%eax
80101410:	8b 75 08             	mov    0x8(%ebp),%esi
80101413:	89 45 dc             	mov    %eax,-0x24(%ebp)
80101416:	8b 45 10             	mov    0x10(%ebp),%eax
  int r;

  if(f->writable == 0)
80101419:	80 7e 09 00          	cmpb   $0x0,0x9(%esi)
{
8010141d:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  if(f->writable == 0)
80101420:	0f 84 c1 00 00 00    	je     801014e7 <filewrite+0xe7>
    return -1;
  if(f->type == FD_PIPE)
80101426:	8b 06                	mov    (%esi),%eax
80101428:	83 f8 01             	cmp    $0x1,%eax
8010142b:	0f 84 c3 00 00 00    	je     801014f4 <filewrite+0xf4>
    return pipewrite(f->pipe, addr, n);
  if(f->type == FD_INODE){
80101431:	83 f8 02             	cmp    $0x2,%eax
80101434:	0f 85 cc 00 00 00    	jne    80101506 <filewrite+0x106>
    // and 2 blocks of slop for non-aligned writes.
    // this really belongs lower down, since writei()
    // might be writing a device like the console.
    int max = ((MAXOPBLOCKS-1-1-2) / 2) * 512;
    int i = 0;
    while(i < n){
8010143a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
    int i = 0;
8010143d:	31 ff                	xor    %edi,%edi
    while(i < n){
8010143f:	85 c0                	test   %eax,%eax
80101441:	7f 34                	jg     80101477 <filewrite+0x77>
80101443:	e9 98 00 00 00       	jmp    801014e0 <filewrite+0xe0>
80101448:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010144f:	90                   	nop
        n1 = max;

      begin_op();
      ilock(f->ip);
      if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
        f->off += r;
80101450:	01 46 14             	add    %eax,0x14(%esi)
      iunlock(f->ip);
80101453:	83 ec 0c             	sub    $0xc,%esp
80101456:	ff 76 10             	pushl  0x10(%esi)
        f->off += r;
80101459:	89 45 e0             	mov    %eax,-0x20(%ebp)
      iunlock(f->ip);
8010145c:	e8 6f 15 00 00       	call   801029d0 <iunlock>
      end_op();
80101461:	e8 aa fa ff ff       	call   80100f10 <end_op>

      if(r < 0)
        break;
      if(r != n1)
80101466:	8b 45 e0             	mov    -0x20(%ebp),%eax
80101469:	83 c4 10             	add    $0x10,%esp
8010146c:	39 c3                	cmp    %eax,%ebx
8010146e:	75 60                	jne    801014d0 <filewrite+0xd0>
        panic("short filewrite");
      i += r;
80101470:	01 df                	add    %ebx,%edi
    while(i < n){
80101472:	39 7d e4             	cmp    %edi,-0x1c(%ebp)
80101475:	7e 69                	jle    801014e0 <filewrite+0xe0>
      int n1 = n - i;
80101477:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
8010147a:	b8 00 06 00 00       	mov    $0x600,%eax
8010147f:	29 fb                	sub    %edi,%ebx
      if(n1 > max)
80101481:	81 fb 00 06 00 00    	cmp    $0x600,%ebx
80101487:	0f 4f d8             	cmovg  %eax,%ebx
      begin_op();
8010148a:	e8 11 fa ff ff       	call   80100ea0 <begin_op>
      ilock(f->ip);
8010148f:	83 ec 0c             	sub    $0xc,%esp
80101492:	ff 76 10             	pushl  0x10(%esi)
80101495:	e8 56 14 00 00       	call   801028f0 <ilock>
      if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
8010149a:	8b 45 dc             	mov    -0x24(%ebp),%eax
8010149d:	53                   	push   %ebx
8010149e:	ff 76 14             	pushl  0x14(%esi)
801014a1:	01 f8                	add    %edi,%eax
801014a3:	50                   	push   %eax
801014a4:	ff 76 10             	pushl  0x10(%esi)
801014a7:	e8 44 18 00 00       	call   80102cf0 <writei>
801014ac:	83 c4 20             	add    $0x20,%esp
801014af:	85 c0                	test   %eax,%eax
801014b1:	7f 9d                	jg     80101450 <filewrite+0x50>
      iunlock(f->ip);
801014b3:	83 ec 0c             	sub    $0xc,%esp
801014b6:	ff 76 10             	pushl  0x10(%esi)
801014b9:	89 45 e4             	mov    %eax,-0x1c(%ebp)
801014bc:	e8 0f 15 00 00       	call   801029d0 <iunlock>
      end_op();
801014c1:	e8 4a fa ff ff       	call   80100f10 <end_op>
      if(r < 0)
801014c6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
801014c9:	83 c4 10             	add    $0x10,%esp
801014cc:	85 c0                	test   %eax,%eax
801014ce:	75 17                	jne    801014e7 <filewrite+0xe7>
        panic("short filewrite");
801014d0:	83 ec 0c             	sub    $0xc,%esp
801014d3:	68 69 73 10 80       	push   $0x80107369
801014d8:	e8 e3 04 00 00       	call   801019c0 <panic>
801014dd:	8d 76 00             	lea    0x0(%esi),%esi
    }
    return i == n ? n : -1;
801014e0:	89 f8                	mov    %edi,%eax
801014e2:	3b 7d e4             	cmp    -0x1c(%ebp),%edi
801014e5:	74 05                	je     801014ec <filewrite+0xec>
801014e7:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  }
  panic("filewrite");
}
801014ec:	8d 65 f4             	lea    -0xc(%ebp),%esp
801014ef:	5b                   	pop    %ebx
801014f0:	5e                   	pop    %esi
801014f1:	5f                   	pop    %edi
801014f2:	5d                   	pop    %ebp
801014f3:	c3                   	ret    
    return pipewrite(f->pipe, addr, n);
801014f4:	8b 46 0c             	mov    0xc(%esi),%eax
801014f7:	89 45 08             	mov    %eax,0x8(%ebp)
}
801014fa:	8d 65 f4             	lea    -0xc(%ebp),%esp
801014fd:	5b                   	pop    %ebx
801014fe:	5e                   	pop    %esi
801014ff:	5f                   	pop    %edi
80101500:	5d                   	pop    %ebp
    return pipewrite(f->pipe, addr, n);
80101501:	e9 ca 01 00 00       	jmp    801016d0 <pipewrite>
  panic("filewrite");
80101506:	83 ec 0c             	sub    $0xc,%esp
80101509:	68 6f 73 10 80       	push   $0x8010736f
8010150e:	e8 ad 04 00 00       	call   801019c0 <panic>
80101513:	66 90                	xchg   %ax,%ax
80101515:	66 90                	xchg   %ax,%ax
80101517:	66 90                	xchg   %ax,%ax
80101519:	66 90                	xchg   %ax,%ax
8010151b:	66 90                	xchg   %ax,%ax
8010151d:	66 90                	xchg   %ax,%ax
8010151f:	90                   	nop

80101520 <pipealloc>:
  int writeopen;  // write fd is still open
};

int
pipealloc(struct file **f0, struct file **f1)
{
80101520:	f3 0f 1e fb          	endbr32 
80101524:	55                   	push   %ebp
80101525:	89 e5                	mov    %esp,%ebp
80101527:	57                   	push   %edi
80101528:	56                   	push   %esi
80101529:	53                   	push   %ebx
8010152a:	83 ec 0c             	sub    $0xc,%esp
8010152d:	8b 5d 08             	mov    0x8(%ebp),%ebx
80101530:	8b 75 0c             	mov    0xc(%ebp),%esi
  struct pipe *p;

  p = 0;
  *f0 = *f1 = 0;
80101533:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
80101539:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0)
8010153f:	e8 2c fc ff ff       	call   80101170 <filealloc>
80101544:	89 03                	mov    %eax,(%ebx)
80101546:	85 c0                	test   %eax,%eax
80101548:	0f 84 ac 00 00 00    	je     801015fa <pipealloc+0xda>
8010154e:	e8 1d fc ff ff       	call   80101170 <filealloc>
80101553:	89 06                	mov    %eax,(%esi)
80101555:	85 c0                	test   %eax,%eax
80101557:	0f 84 8b 00 00 00    	je     801015e8 <pipealloc+0xc8>
    goto bad;
  if((p = (struct pipe*)kalloc()) == 0)
8010155d:	e8 fe 3b 00 00       	call   80105160 <kalloc>
80101562:	89 c7                	mov    %eax,%edi
80101564:	85 c0                	test   %eax,%eax
80101566:	0f 84 b4 00 00 00    	je     80101620 <pipealloc+0x100>
    goto bad;
  p->readopen = 1;
8010156c:	c7 80 3c 02 00 00 01 	movl   $0x1,0x23c(%eax)
80101573:	00 00 00 
  p->writeopen = 1;
  p->nwrite = 0;
  p->nread = 0;
  initlock(&p->lock, "pipe");
80101576:	83 ec 08             	sub    $0x8,%esp
  p->writeopen = 1;
80101579:	c7 80 40 02 00 00 01 	movl   $0x1,0x240(%eax)
80101580:	00 00 00 
  p->nwrite = 0;
80101583:	c7 80 38 02 00 00 00 	movl   $0x0,0x238(%eax)
8010158a:	00 00 00 
  p->nread = 0;
8010158d:	c7 80 34 02 00 00 00 	movl   $0x0,0x234(%eax)
80101594:	00 00 00 
  initlock(&p->lock, "pipe");
80101597:	68 79 73 10 80       	push   $0x80107379
8010159c:	50                   	push   %eax
8010159d:	e8 6e ed ff ff       	call   80100310 <initlock>
  (*f0)->type = FD_PIPE;
801015a2:	8b 03                	mov    (%ebx),%eax
  (*f0)->pipe = p;
  (*f1)->type = FD_PIPE;
  (*f1)->readable = 0;
  (*f1)->writable = 1;
  (*f1)->pipe = p;
  return 0;
801015a4:	83 c4 10             	add    $0x10,%esp
  (*f0)->type = FD_PIPE;
801015a7:	c7 00 01 00 00 00    	movl   $0x1,(%eax)
  (*f0)->readable = 1;
801015ad:	8b 03                	mov    (%ebx),%eax
801015af:	c6 40 08 01          	movb   $0x1,0x8(%eax)
  (*f0)->writable = 0;
801015b3:	8b 03                	mov    (%ebx),%eax
801015b5:	c6 40 09 00          	movb   $0x0,0x9(%eax)
  (*f0)->pipe = p;
801015b9:	8b 03                	mov    (%ebx),%eax
801015bb:	89 78 0c             	mov    %edi,0xc(%eax)
  (*f1)->type = FD_PIPE;
801015be:	8b 06                	mov    (%esi),%eax
801015c0:	c7 00 01 00 00 00    	movl   $0x1,(%eax)
  (*f1)->readable = 0;
801015c6:	8b 06                	mov    (%esi),%eax
801015c8:	c6 40 08 00          	movb   $0x0,0x8(%eax)
  (*f1)->writable = 1;
801015cc:	8b 06                	mov    (%esi),%eax
801015ce:	c6 40 09 01          	movb   $0x1,0x9(%eax)
  (*f1)->pipe = p;
801015d2:	8b 06                	mov    (%esi),%eax
801015d4:	89 78 0c             	mov    %edi,0xc(%eax)
  if(*f0)
    fileclose(*f0);
  if(*f1)
    fileclose(*f1);
  return -1;
}
801015d7:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return 0;
801015da:	31 c0                	xor    %eax,%eax
}
801015dc:	5b                   	pop    %ebx
801015dd:	5e                   	pop    %esi
801015de:	5f                   	pop    %edi
801015df:	5d                   	pop    %ebp
801015e0:	c3                   	ret    
801015e1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  if(*f0)
801015e8:	8b 03                	mov    (%ebx),%eax
801015ea:	85 c0                	test   %eax,%eax
801015ec:	74 1e                	je     8010160c <pipealloc+0xec>
    fileclose(*f0);
801015ee:	83 ec 0c             	sub    $0xc,%esp
801015f1:	50                   	push   %eax
801015f2:	e8 39 fc ff ff       	call   80101230 <fileclose>
801015f7:	83 c4 10             	add    $0x10,%esp
  if(*f1)
801015fa:	8b 06                	mov    (%esi),%eax
801015fc:	85 c0                	test   %eax,%eax
801015fe:	74 0c                	je     8010160c <pipealloc+0xec>
    fileclose(*f1);
80101600:	83 ec 0c             	sub    $0xc,%esp
80101603:	50                   	push   %eax
80101604:	e8 27 fc ff ff       	call   80101230 <fileclose>
80101609:	83 c4 10             	add    $0x10,%esp
}
8010160c:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return -1;
8010160f:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80101614:	5b                   	pop    %ebx
80101615:	5e                   	pop    %esi
80101616:	5f                   	pop    %edi
80101617:	5d                   	pop    %ebp
80101618:	c3                   	ret    
80101619:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  if(*f0)
80101620:	8b 03                	mov    (%ebx),%eax
80101622:	85 c0                	test   %eax,%eax
80101624:	75 c8                	jne    801015ee <pipealloc+0xce>
80101626:	eb d2                	jmp    801015fa <pipealloc+0xda>
80101628:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010162f:	90                   	nop

80101630 <pipeclose>:

void
pipeclose(struct pipe *p, int writable)
{
80101630:	f3 0f 1e fb          	endbr32 
80101634:	55                   	push   %ebp
80101635:	89 e5                	mov    %esp,%ebp
80101637:	56                   	push   %esi
80101638:	53                   	push   %ebx
80101639:	8b 5d 08             	mov    0x8(%ebp),%ebx
8010163c:	8b 75 0c             	mov    0xc(%ebp),%esi
  acquire(&p->lock);
8010163f:	83 ec 0c             	sub    $0xc,%esp
80101642:	53                   	push   %ebx
80101643:	e8 48 ee ff ff       	call   80100490 <acquire>
  if(writable){
80101648:	83 c4 10             	add    $0x10,%esp
8010164b:	85 f6                	test   %esi,%esi
8010164d:	74 41                	je     80101690 <pipeclose+0x60>
    p->writeopen = 0;
    wakeup(&p->nread);
8010164f:	83 ec 0c             	sub    $0xc,%esp
80101652:	8d 83 34 02 00 00    	lea    0x234(%ebx),%eax
    p->writeopen = 0;
80101658:	c7 83 40 02 00 00 00 	movl   $0x0,0x240(%ebx)
8010165f:	00 00 00 
    wakeup(&p->nread);
80101662:	50                   	push   %eax
80101663:	e8 b8 2a 00 00       	call   80104120 <wakeup>
80101668:	83 c4 10             	add    $0x10,%esp
  } else {
    p->readopen = 0;
    wakeup(&p->nwrite);
  }
  if(p->readopen == 0 && p->writeopen == 0){
8010166b:	8b 93 3c 02 00 00    	mov    0x23c(%ebx),%edx
80101671:	85 d2                	test   %edx,%edx
80101673:	75 0a                	jne    8010167f <pipeclose+0x4f>
80101675:	8b 83 40 02 00 00    	mov    0x240(%ebx),%eax
8010167b:	85 c0                	test   %eax,%eax
8010167d:	74 31                	je     801016b0 <pipeclose+0x80>
    release(&p->lock);
    kfree((char*)p);
  } else
    release(&p->lock);
8010167f:	89 5d 08             	mov    %ebx,0x8(%ebp)
}
80101682:	8d 65 f8             	lea    -0x8(%ebp),%esp
80101685:	5b                   	pop    %ebx
80101686:	5e                   	pop    %esi
80101687:	5d                   	pop    %ebp
    release(&p->lock);
80101688:	e9 c3 ee ff ff       	jmp    80100550 <release>
8010168d:	8d 76 00             	lea    0x0(%esi),%esi
    wakeup(&p->nwrite);
80101690:	83 ec 0c             	sub    $0xc,%esp
80101693:	8d 83 38 02 00 00    	lea    0x238(%ebx),%eax
    p->readopen = 0;
80101699:	c7 83 3c 02 00 00 00 	movl   $0x0,0x23c(%ebx)
801016a0:	00 00 00 
    wakeup(&p->nwrite);
801016a3:	50                   	push   %eax
801016a4:	e8 77 2a 00 00       	call   80104120 <wakeup>
801016a9:	83 c4 10             	add    $0x10,%esp
801016ac:	eb bd                	jmp    8010166b <pipeclose+0x3b>
801016ae:	66 90                	xchg   %ax,%ax
    release(&p->lock);
801016b0:	83 ec 0c             	sub    $0xc,%esp
801016b3:	53                   	push   %ebx
801016b4:	e8 97 ee ff ff       	call   80100550 <release>
    kfree((char*)p);
801016b9:	89 5d 08             	mov    %ebx,0x8(%ebp)
801016bc:	83 c4 10             	add    $0x10,%esp
}
801016bf:	8d 65 f8             	lea    -0x8(%ebp),%esp
801016c2:	5b                   	pop    %ebx
801016c3:	5e                   	pop    %esi
801016c4:	5d                   	pop    %ebp
    kfree((char*)p);
801016c5:	e9 d6 38 00 00       	jmp    80104fa0 <kfree>
801016ca:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801016d0 <pipewrite>:

//PAGEBREAK: 40
int
pipewrite(struct pipe *p, char *addr, int n)
{
801016d0:	f3 0f 1e fb          	endbr32 
801016d4:	55                   	push   %ebp
801016d5:	89 e5                	mov    %esp,%ebp
801016d7:	57                   	push   %edi
801016d8:	56                   	push   %esi
801016d9:	53                   	push   %ebx
801016da:	83 ec 28             	sub    $0x28,%esp
801016dd:	8b 5d 08             	mov    0x8(%ebp),%ebx
  int i;

  acquire(&p->lock);
801016e0:	53                   	push   %ebx
801016e1:	e8 aa ed ff ff       	call   80100490 <acquire>
  for(i = 0; i < n; i++){
801016e6:	8b 45 10             	mov    0x10(%ebp),%eax
801016e9:	83 c4 10             	add    $0x10,%esp
801016ec:	85 c0                	test   %eax,%eax
801016ee:	0f 8e bc 00 00 00    	jle    801017b0 <pipewrite+0xe0>
801016f4:	8b 45 0c             	mov    0xc(%ebp),%eax
801016f7:	8b 8b 38 02 00 00    	mov    0x238(%ebx),%ecx
    while(p->nwrite == p->nread + PIPESIZE){  //DOC: pipewrite-full
      if(p->readopen == 0 || myproc()->killed){
        release(&p->lock);
        return -1;
      }
      wakeup(&p->nread);
801016fd:	8d bb 34 02 00 00    	lea    0x234(%ebx),%edi
80101703:	89 45 e4             	mov    %eax,-0x1c(%ebp)
80101706:	03 45 10             	add    0x10(%ebp),%eax
80101709:	89 45 e0             	mov    %eax,-0x20(%ebp)
    while(p->nwrite == p->nread + PIPESIZE){  //DOC: pipewrite-full
8010170c:	8b 83 34 02 00 00    	mov    0x234(%ebx),%eax
      sleep(&p->nwrite, &p->lock);  //DOC: pipewrite-sleep
80101712:	8d b3 38 02 00 00    	lea    0x238(%ebx),%esi
    while(p->nwrite == p->nread + PIPESIZE){  //DOC: pipewrite-full
80101718:	89 ca                	mov    %ecx,%edx
8010171a:	05 00 02 00 00       	add    $0x200,%eax
8010171f:	39 c1                	cmp    %eax,%ecx
80101721:	74 3b                	je     8010175e <pipewrite+0x8e>
80101723:	eb 63                	jmp    80101788 <pipewrite+0xb8>
80101725:	8d 76 00             	lea    0x0(%esi),%esi
      if(p->readopen == 0 || myproc()->killed){
80101728:	e8 13 22 00 00       	call   80103940 <myproc>
8010172d:	8b 48 24             	mov    0x24(%eax),%ecx
80101730:	85 c9                	test   %ecx,%ecx
80101732:	75 34                	jne    80101768 <pipewrite+0x98>
      wakeup(&p->nread);
80101734:	83 ec 0c             	sub    $0xc,%esp
80101737:	57                   	push   %edi
80101738:	e8 e3 29 00 00       	call   80104120 <wakeup>
      sleep(&p->nwrite, &p->lock);  //DOC: pipewrite-sleep
8010173d:	58                   	pop    %eax
8010173e:	5a                   	pop    %edx
8010173f:	53                   	push   %ebx
80101740:	56                   	push   %esi
80101741:	e8 1a 28 00 00       	call   80103f60 <sleep>
    while(p->nwrite == p->nread + PIPESIZE){  //DOC: pipewrite-full
80101746:	8b 83 34 02 00 00    	mov    0x234(%ebx),%eax
8010174c:	8b 93 38 02 00 00    	mov    0x238(%ebx),%edx
80101752:	83 c4 10             	add    $0x10,%esp
80101755:	05 00 02 00 00       	add    $0x200,%eax
8010175a:	39 c2                	cmp    %eax,%edx
8010175c:	75 2a                	jne    80101788 <pipewrite+0xb8>
      if(p->readopen == 0 || myproc()->killed){
8010175e:	8b 83 3c 02 00 00    	mov    0x23c(%ebx),%eax
80101764:	85 c0                	test   %eax,%eax
80101766:	75 c0                	jne    80101728 <pipewrite+0x58>
        release(&p->lock);
80101768:	83 ec 0c             	sub    $0xc,%esp
8010176b:	53                   	push   %ebx
8010176c:	e8 df ed ff ff       	call   80100550 <release>
        return -1;
80101771:	83 c4 10             	add    $0x10,%esp
80101774:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    p->data[p->nwrite++ % PIPESIZE] = addr[i];
  }
  wakeup(&p->nread);  //DOC: pipewrite-wakeup1
  release(&p->lock);
  return n;
}
80101779:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010177c:	5b                   	pop    %ebx
8010177d:	5e                   	pop    %esi
8010177e:	5f                   	pop    %edi
8010177f:	5d                   	pop    %ebp
80101780:	c3                   	ret    
80101781:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    p->data[p->nwrite++ % PIPESIZE] = addr[i];
80101788:	8b 75 e4             	mov    -0x1c(%ebp),%esi
8010178b:	8d 4a 01             	lea    0x1(%edx),%ecx
8010178e:	81 e2 ff 01 00 00    	and    $0x1ff,%edx
80101794:	89 8b 38 02 00 00    	mov    %ecx,0x238(%ebx)
8010179a:	0f b6 06             	movzbl (%esi),%eax
8010179d:	83 c6 01             	add    $0x1,%esi
801017a0:	89 75 e4             	mov    %esi,-0x1c(%ebp)
801017a3:	88 44 13 34          	mov    %al,0x34(%ebx,%edx,1)
  for(i = 0; i < n; i++){
801017a7:	3b 75 e0             	cmp    -0x20(%ebp),%esi
801017aa:	0f 85 5c ff ff ff    	jne    8010170c <pipewrite+0x3c>
  wakeup(&p->nread);  //DOC: pipewrite-wakeup1
801017b0:	83 ec 0c             	sub    $0xc,%esp
801017b3:	8d 83 34 02 00 00    	lea    0x234(%ebx),%eax
801017b9:	50                   	push   %eax
801017ba:	e8 61 29 00 00       	call   80104120 <wakeup>
  release(&p->lock);
801017bf:	89 1c 24             	mov    %ebx,(%esp)
801017c2:	e8 89 ed ff ff       	call   80100550 <release>
  return n;
801017c7:	8b 45 10             	mov    0x10(%ebp),%eax
801017ca:	83 c4 10             	add    $0x10,%esp
801017cd:	eb aa                	jmp    80101779 <pipewrite+0xa9>
801017cf:	90                   	nop

801017d0 <piperead>:

int
piperead(struct pipe *p, char *addr, int n)
{
801017d0:	f3 0f 1e fb          	endbr32 
801017d4:	55                   	push   %ebp
801017d5:	89 e5                	mov    %esp,%ebp
801017d7:	57                   	push   %edi
801017d8:	56                   	push   %esi
801017d9:	53                   	push   %ebx
801017da:	83 ec 18             	sub    $0x18,%esp
801017dd:	8b 75 08             	mov    0x8(%ebp),%esi
801017e0:	8b 7d 0c             	mov    0xc(%ebp),%edi
  int i;

  acquire(&p->lock);
801017e3:	56                   	push   %esi
801017e4:	8d 9e 34 02 00 00    	lea    0x234(%esi),%ebx
801017ea:	e8 a1 ec ff ff       	call   80100490 <acquire>
  while(p->nread == p->nwrite && p->writeopen){  //DOC: pipe-empty
801017ef:	8b 86 34 02 00 00    	mov    0x234(%esi),%eax
801017f5:	83 c4 10             	add    $0x10,%esp
801017f8:	39 86 38 02 00 00    	cmp    %eax,0x238(%esi)
801017fe:	74 33                	je     80101833 <piperead+0x63>
80101800:	eb 3b                	jmp    8010183d <piperead+0x6d>
80101802:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    if(myproc()->killed){
80101808:	e8 33 21 00 00       	call   80103940 <myproc>
8010180d:	8b 48 24             	mov    0x24(%eax),%ecx
80101810:	85 c9                	test   %ecx,%ecx
80101812:	0f 85 88 00 00 00    	jne    801018a0 <piperead+0xd0>
      release(&p->lock);
      return -1;
    }
    sleep(&p->nread, &p->lock); //DOC: piperead-sleep
80101818:	83 ec 08             	sub    $0x8,%esp
8010181b:	56                   	push   %esi
8010181c:	53                   	push   %ebx
8010181d:	e8 3e 27 00 00       	call   80103f60 <sleep>
  while(p->nread == p->nwrite && p->writeopen){  //DOC: pipe-empty
80101822:	8b 86 38 02 00 00    	mov    0x238(%esi),%eax
80101828:	83 c4 10             	add    $0x10,%esp
8010182b:	39 86 34 02 00 00    	cmp    %eax,0x234(%esi)
80101831:	75 0a                	jne    8010183d <piperead+0x6d>
80101833:	8b 86 40 02 00 00    	mov    0x240(%esi),%eax
80101839:	85 c0                	test   %eax,%eax
8010183b:	75 cb                	jne    80101808 <piperead+0x38>
  }
  for(i = 0; i < n; i++){  //DOC: piperead-copy
8010183d:	8b 55 10             	mov    0x10(%ebp),%edx
80101840:	31 db                	xor    %ebx,%ebx
80101842:	85 d2                	test   %edx,%edx
80101844:	7f 28                	jg     8010186e <piperead+0x9e>
80101846:	eb 34                	jmp    8010187c <piperead+0xac>
80101848:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010184f:	90                   	nop
    if(p->nread == p->nwrite)
      break;
    addr[i] = p->data[p->nread++ % PIPESIZE];
80101850:	8d 48 01             	lea    0x1(%eax),%ecx
80101853:	25 ff 01 00 00       	and    $0x1ff,%eax
80101858:	89 8e 34 02 00 00    	mov    %ecx,0x234(%esi)
8010185e:	0f b6 44 06 34       	movzbl 0x34(%esi,%eax,1),%eax
80101863:	88 04 1f             	mov    %al,(%edi,%ebx,1)
  for(i = 0; i < n; i++){  //DOC: piperead-copy
80101866:	83 c3 01             	add    $0x1,%ebx
80101869:	39 5d 10             	cmp    %ebx,0x10(%ebp)
8010186c:	74 0e                	je     8010187c <piperead+0xac>
    if(p->nread == p->nwrite)
8010186e:	8b 86 34 02 00 00    	mov    0x234(%esi),%eax
80101874:	3b 86 38 02 00 00    	cmp    0x238(%esi),%eax
8010187a:	75 d4                	jne    80101850 <piperead+0x80>
  }
  wakeup(&p->nwrite);  //DOC: piperead-wakeup
8010187c:	83 ec 0c             	sub    $0xc,%esp
8010187f:	8d 86 38 02 00 00    	lea    0x238(%esi),%eax
80101885:	50                   	push   %eax
80101886:	e8 95 28 00 00       	call   80104120 <wakeup>
  release(&p->lock);
8010188b:	89 34 24             	mov    %esi,(%esp)
8010188e:	e8 bd ec ff ff       	call   80100550 <release>
  return i;
80101893:	83 c4 10             	add    $0x10,%esp
}
80101896:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101899:	89 d8                	mov    %ebx,%eax
8010189b:	5b                   	pop    %ebx
8010189c:	5e                   	pop    %esi
8010189d:	5f                   	pop    %edi
8010189e:	5d                   	pop    %ebp
8010189f:	c3                   	ret    
      release(&p->lock);
801018a0:	83 ec 0c             	sub    $0xc,%esp
      return -1;
801018a3:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
      release(&p->lock);
801018a8:	56                   	push   %esi
801018a9:	e8 a2 ec ff ff       	call   80100550 <release>
      return -1;
801018ae:	83 c4 10             	add    $0x10,%esp
}
801018b1:	8d 65 f4             	lea    -0xc(%ebp),%esp
801018b4:	89 d8                	mov    %ebx,%eax
801018b6:	5b                   	pop    %ebx
801018b7:	5e                   	pop    %esi
801018b8:	5f                   	pop    %edi
801018b9:	5d                   	pop    %ebp
801018ba:	c3                   	ret    
801018bb:	66 90                	xchg   %ax,%ax
801018bd:	66 90                	xchg   %ax,%ax
801018bf:	90                   	nop

801018c0 <consoleread>:
  }
}

int
consoleread(struct inode *ip, char *dst, int n)
{
801018c0:	f3 0f 1e fb          	endbr32 
801018c4:	55                   	push   %ebp
801018c5:	89 e5                	mov    %esp,%ebp
801018c7:	57                   	push   %edi
801018c8:	56                   	push   %esi
801018c9:	53                   	push   %ebx
801018ca:	83 ec 18             	sub    $0x18,%esp
  uint target;
  int c;

  iunlock(ip);
801018cd:	ff 75 08             	pushl  0x8(%ebp)
{
801018d0:	8b 5d 10             	mov    0x10(%ebp),%ebx
  target = n;
801018d3:	89 de                	mov    %ebx,%esi
  iunlock(ip);
801018d5:	e8 f6 10 00 00       	call   801029d0 <iunlock>
  acquire(&cons.lock);
801018da:	c7 04 24 20 98 10 80 	movl   $0x80109820,(%esp)
801018e1:	e8 aa eb ff ff       	call   80100490 <acquire>
        // caller gets a 0-byte result.
        input.r--;
      }
      break;
    }
    *dst++ = c;
801018e6:	8b 7d 0c             	mov    0xc(%ebp),%edi
  while(n > 0){
801018e9:	83 c4 10             	add    $0x10,%esp
    *dst++ = c;
801018ec:	01 df                	add    %ebx,%edi
  while(n > 0){
801018ee:	85 db                	test   %ebx,%ebx
801018f0:	0f 8e 97 00 00 00    	jle    8010198d <consoleread+0xcd>
    while(input.r == input.w){
801018f6:	a1 20 ba 10 80       	mov    0x8010ba20,%eax
801018fb:	3b 05 24 ba 10 80    	cmp    0x8010ba24,%eax
80101901:	74 27                	je     8010192a <consoleread+0x6a>
80101903:	eb 5b                	jmp    80101960 <consoleread+0xa0>
80101905:	8d 76 00             	lea    0x0(%esi),%esi
      sleep(&input.r, &cons.lock);
80101908:	83 ec 08             	sub    $0x8,%esp
8010190b:	68 20 98 10 80       	push   $0x80109820
80101910:	68 20 ba 10 80       	push   $0x8010ba20
80101915:	e8 46 26 00 00       	call   80103f60 <sleep>
    while(input.r == input.w){
8010191a:	a1 20 ba 10 80       	mov    0x8010ba20,%eax
8010191f:	83 c4 10             	add    $0x10,%esp
80101922:	3b 05 24 ba 10 80    	cmp    0x8010ba24,%eax
80101928:	75 36                	jne    80101960 <consoleread+0xa0>
      if(myproc()->killed){
8010192a:	e8 11 20 00 00       	call   80103940 <myproc>
8010192f:	8b 48 24             	mov    0x24(%eax),%ecx
80101932:	85 c9                	test   %ecx,%ecx
80101934:	74 d2                	je     80101908 <consoleread+0x48>
        release(&cons.lock);
80101936:	83 ec 0c             	sub    $0xc,%esp
80101939:	68 20 98 10 80       	push   $0x80109820
8010193e:	e8 0d ec ff ff       	call   80100550 <release>
        ilock(ip);
80101943:	5a                   	pop    %edx
80101944:	ff 75 08             	pushl  0x8(%ebp)
80101947:	e8 a4 0f 00 00       	call   801028f0 <ilock>
        return -1;
8010194c:	83 c4 10             	add    $0x10,%esp
  }
  release(&cons.lock);
  ilock(ip);

  return target - n;
}
8010194f:	8d 65 f4             	lea    -0xc(%ebp),%esp
        return -1;
80101952:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80101957:	5b                   	pop    %ebx
80101958:	5e                   	pop    %esi
80101959:	5f                   	pop    %edi
8010195a:	5d                   	pop    %ebp
8010195b:	c3                   	ret    
8010195c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    c = input.buf[input.r++ % INPUT_BUF];
80101960:	8d 50 01             	lea    0x1(%eax),%edx
80101963:	89 15 20 ba 10 80    	mov    %edx,0x8010ba20
80101969:	89 c2                	mov    %eax,%edx
8010196b:	83 e2 7f             	and    $0x7f,%edx
8010196e:	0f be 8a a0 b9 10 80 	movsbl -0x7fef4660(%edx),%ecx
    if(c == C('D')){  // EOF
80101975:	80 f9 04             	cmp    $0x4,%cl
80101978:	74 38                	je     801019b2 <consoleread+0xf2>
    *dst++ = c;
8010197a:	89 d8                	mov    %ebx,%eax
    --n;
8010197c:	83 eb 01             	sub    $0x1,%ebx
    *dst++ = c;
8010197f:	f7 d8                	neg    %eax
80101981:	88 0c 07             	mov    %cl,(%edi,%eax,1)
    if(c == '\n')
80101984:	83 f9 0a             	cmp    $0xa,%ecx
80101987:	0f 85 61 ff ff ff    	jne    801018ee <consoleread+0x2e>
  release(&cons.lock);
8010198d:	83 ec 0c             	sub    $0xc,%esp
80101990:	68 20 98 10 80       	push   $0x80109820
80101995:	e8 b6 eb ff ff       	call   80100550 <release>
  ilock(ip);
8010199a:	58                   	pop    %eax
8010199b:	ff 75 08             	pushl  0x8(%ebp)
8010199e:	e8 4d 0f 00 00       	call   801028f0 <ilock>
  return target - n;
801019a3:	89 f0                	mov    %esi,%eax
801019a5:	83 c4 10             	add    $0x10,%esp
}
801019a8:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return target - n;
801019ab:	29 d8                	sub    %ebx,%eax
}
801019ad:	5b                   	pop    %ebx
801019ae:	5e                   	pop    %esi
801019af:	5f                   	pop    %edi
801019b0:	5d                   	pop    %ebp
801019b1:	c3                   	ret    
      if(n < target){
801019b2:	39 f3                	cmp    %esi,%ebx
801019b4:	73 d7                	jae    8010198d <consoleread+0xcd>
        input.r--;
801019b6:	a3 20 ba 10 80       	mov    %eax,0x8010ba20
801019bb:	eb d0                	jmp    8010198d <consoleread+0xcd>
801019bd:	8d 76 00             	lea    0x0(%esi),%esi

801019c0 <panic>:
{
801019c0:	f3 0f 1e fb          	endbr32 
801019c4:	55                   	push   %ebp
801019c5:	89 e5                	mov    %esp,%ebp
801019c7:	56                   	push   %esi
801019c8:	53                   	push   %ebx
801019c9:	83 ec 30             	sub    $0x30,%esp
  asm volatile("cli");
801019cc:	fa                   	cli    
  cons.locking = 0;
801019cd:	c7 05 54 98 10 80 00 	movl   $0x0,0x80109854
801019d4:	00 00 00 
  getcallerpcs(&s, pcs);
801019d7:	8d 5d d0             	lea    -0x30(%ebp),%ebx
801019da:	8d 75 f8             	lea    -0x8(%ebp),%esi
  cprintf("lapicid %d: panic: ", lapicid());
801019dd:	e8 ce ed ff ff       	call   801007b0 <lapicid>
801019e2:	83 ec 08             	sub    $0x8,%esp
801019e5:	50                   	push   %eax
801019e6:	68 7e 73 10 80       	push   $0x8010737e
801019eb:	e8 f0 02 00 00       	call   80101ce0 <cprintf>
  cprintf(s);
801019f0:	58                   	pop    %eax
801019f1:	ff 75 08             	pushl  0x8(%ebp)
801019f4:	e8 e7 02 00 00       	call   80101ce0 <cprintf>
  cprintf("\n");
801019f9:	c7 04 24 8d 79 10 80 	movl   $0x8010798d,(%esp)
80101a00:	e8 db 02 00 00       	call   80101ce0 <cprintf>
  getcallerpcs(&s, pcs);
80101a05:	8d 45 08             	lea    0x8(%ebp),%eax
80101a08:	5a                   	pop    %edx
80101a09:	59                   	pop    %ecx
80101a0a:	53                   	push   %ebx
80101a0b:	50                   	push   %eax
80101a0c:	e8 1f e9 ff ff       	call   80100330 <getcallerpcs>
  for(i=0; i<10; i++)
80101a11:	83 c4 10             	add    $0x10,%esp
    cprintf(" %p", pcs[i]);
80101a14:	83 ec 08             	sub    $0x8,%esp
80101a17:	ff 33                	pushl  (%ebx)
80101a19:	83 c3 04             	add    $0x4,%ebx
80101a1c:	68 92 73 10 80       	push   $0x80107392
80101a21:	e8 ba 02 00 00       	call   80101ce0 <cprintf>
  for(i=0; i<10; i++)
80101a26:	83 c4 10             	add    $0x10,%esp
80101a29:	39 f3                	cmp    %esi,%ebx
80101a2b:	75 e7                	jne    80101a14 <panic+0x54>
  panicked = 1; // freeze other CPU
80101a2d:	c7 05 58 98 10 80 01 	movl   $0x1,0x80109858
80101a34:	00 00 00 
  for(;;)
80101a37:	eb fe                	jmp    80101a37 <panic+0x77>
80101a39:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80101a40 <consputc.part.0>:
consputc(int c)
80101a40:	55                   	push   %ebp
80101a41:	89 e5                	mov    %esp,%ebp
80101a43:	57                   	push   %edi
80101a44:	56                   	push   %esi
80101a45:	53                   	push   %ebx
80101a46:	89 c3                	mov    %eax,%ebx
80101a48:	83 ec 1c             	sub    $0x1c,%esp
  if(c == BACKSPACE){
80101a4b:	3d 00 01 00 00       	cmp    $0x100,%eax
80101a50:	0f 84 ea 00 00 00    	je     80101b40 <consputc.part.0+0x100>
    uartputc(c);
80101a56:	83 ec 0c             	sub    $0xc,%esp
80101a59:	50                   	push   %eax
80101a5a:	e8 91 08 00 00       	call   801022f0 <uartputc>
80101a5f:	83 c4 10             	add    $0x10,%esp
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80101a62:	bf d4 03 00 00       	mov    $0x3d4,%edi
80101a67:	b8 0e 00 00 00       	mov    $0xe,%eax
80101a6c:	89 fa                	mov    %edi,%edx
80101a6e:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80101a6f:	b9 d5 03 00 00       	mov    $0x3d5,%ecx
80101a74:	89 ca                	mov    %ecx,%edx
80101a76:	ec                   	in     (%dx),%al
  pos = inb(CRTPORT+1) << 8;
80101a77:	0f b6 c0             	movzbl %al,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80101a7a:	89 fa                	mov    %edi,%edx
80101a7c:	c1 e0 08             	shl    $0x8,%eax
80101a7f:	89 c6                	mov    %eax,%esi
80101a81:	b8 0f 00 00 00       	mov    $0xf,%eax
80101a86:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80101a87:	89 ca                	mov    %ecx,%edx
80101a89:	ec                   	in     (%dx),%al
  pos |= inb(CRTPORT+1);
80101a8a:	0f b6 c0             	movzbl %al,%eax
80101a8d:	09 f0                	or     %esi,%eax
  if(c == '\n')
80101a8f:	83 fb 0a             	cmp    $0xa,%ebx
80101a92:	0f 84 90 00 00 00    	je     80101b28 <consputc.part.0+0xe8>
  else if(c == BACKSPACE){
80101a98:	81 fb 00 01 00 00    	cmp    $0x100,%ebx
80101a9e:	74 70                	je     80101b10 <consputc.part.0+0xd0>
    crt[pos++] = (c&0xff) | 0x0700;  // black on white
80101aa0:	0f b6 db             	movzbl %bl,%ebx
80101aa3:	8d 70 01             	lea    0x1(%eax),%esi
80101aa6:	80 cf 07             	or     $0x7,%bh
80101aa9:	66 89 9c 00 00 80 0b 	mov    %bx,-0x7ff48000(%eax,%eax,1)
80101ab0:	80 
  if(pos < 0 || pos > 25*80)
80101ab1:	81 fe d0 07 00 00    	cmp    $0x7d0,%esi
80101ab7:	0f 8f f9 00 00 00    	jg     80101bb6 <consputc.part.0+0x176>
  if((pos/80) >= 24){  // Scroll up.
80101abd:	81 fe 7f 07 00 00    	cmp    $0x77f,%esi
80101ac3:	0f 8f a7 00 00 00    	jg     80101b70 <consputc.part.0+0x130>
80101ac9:	89 f0                	mov    %esi,%eax
80101acb:	8d b4 36 00 80 0b 80 	lea    -0x7ff48000(%esi,%esi,1),%esi
80101ad2:	88 45 e7             	mov    %al,-0x19(%ebp)
80101ad5:	0f b6 fc             	movzbl %ah,%edi
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80101ad8:	bb d4 03 00 00       	mov    $0x3d4,%ebx
80101add:	b8 0e 00 00 00       	mov    $0xe,%eax
80101ae2:	89 da                	mov    %ebx,%edx
80101ae4:	ee                   	out    %al,(%dx)
80101ae5:	b9 d5 03 00 00       	mov    $0x3d5,%ecx
80101aea:	89 f8                	mov    %edi,%eax
80101aec:	89 ca                	mov    %ecx,%edx
80101aee:	ee                   	out    %al,(%dx)
80101aef:	b8 0f 00 00 00       	mov    $0xf,%eax
80101af4:	89 da                	mov    %ebx,%edx
80101af6:	ee                   	out    %al,(%dx)
80101af7:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
80101afb:	89 ca                	mov    %ecx,%edx
80101afd:	ee                   	out    %al,(%dx)
  crt[pos] = ' ' | 0x0700;
80101afe:	b8 20 07 00 00       	mov    $0x720,%eax
80101b03:	66 89 06             	mov    %ax,(%esi)
}
80101b06:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101b09:	5b                   	pop    %ebx
80101b0a:	5e                   	pop    %esi
80101b0b:	5f                   	pop    %edi
80101b0c:	5d                   	pop    %ebp
80101b0d:	c3                   	ret    
80101b0e:	66 90                	xchg   %ax,%ax
    if(pos > 0) --pos;
80101b10:	8d 70 ff             	lea    -0x1(%eax),%esi
80101b13:	85 c0                	test   %eax,%eax
80101b15:	75 9a                	jne    80101ab1 <consputc.part.0+0x71>
80101b17:	c6 45 e7 00          	movb   $0x0,-0x19(%ebp)
80101b1b:	be 00 80 0b 80       	mov    $0x800b8000,%esi
80101b20:	31 ff                	xor    %edi,%edi
80101b22:	eb b4                	jmp    80101ad8 <consputc.part.0+0x98>
80101b24:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    pos += 80 - pos%80;
80101b28:	ba cd cc cc cc       	mov    $0xcccccccd,%edx
80101b2d:	f7 e2                	mul    %edx
80101b2f:	c1 ea 06             	shr    $0x6,%edx
80101b32:	8d 04 92             	lea    (%edx,%edx,4),%eax
80101b35:	c1 e0 04             	shl    $0x4,%eax
80101b38:	8d 70 50             	lea    0x50(%eax),%esi
80101b3b:	e9 71 ff ff ff       	jmp    80101ab1 <consputc.part.0+0x71>
    uartputc('\b'); uartputc(' '); uartputc('\b');
80101b40:	83 ec 0c             	sub    $0xc,%esp
80101b43:	6a 08                	push   $0x8
80101b45:	e8 a6 07 00 00       	call   801022f0 <uartputc>
80101b4a:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
80101b51:	e8 9a 07 00 00       	call   801022f0 <uartputc>
80101b56:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
80101b5d:	e8 8e 07 00 00       	call   801022f0 <uartputc>
80101b62:	83 c4 10             	add    $0x10,%esp
80101b65:	e9 f8 fe ff ff       	jmp    80101a62 <consputc.part.0+0x22>
80101b6a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    memmove(crt, crt+80, sizeof(crt[0])*23*80);
80101b70:	83 ec 04             	sub    $0x4,%esp
    pos -= 80;
80101b73:	8d 5e b0             	lea    -0x50(%esi),%ebx
    memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
80101b76:	8d b4 36 60 7f 0b 80 	lea    -0x7ff480a0(%esi,%esi,1),%esi
80101b7d:	bf 07 00 00 00       	mov    $0x7,%edi
    memmove(crt, crt+80, sizeof(crt[0])*23*80);
80101b82:	68 60 0e 00 00       	push   $0xe60
80101b87:	68 a0 80 0b 80       	push   $0x800b80a0
80101b8c:	68 00 80 0b 80       	push   $0x800b8000
80101b91:	e8 da 36 00 00       	call   80105270 <memmove>
    memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
80101b96:	b8 80 07 00 00       	mov    $0x780,%eax
80101b9b:	83 c4 0c             	add    $0xc,%esp
80101b9e:	29 d8                	sub    %ebx,%eax
80101ba0:	01 c0                	add    %eax,%eax
80101ba2:	50                   	push   %eax
80101ba3:	6a 00                	push   $0x0
80101ba5:	56                   	push   %esi
80101ba6:	e8 25 36 00 00       	call   801051d0 <memset>
80101bab:	88 5d e7             	mov    %bl,-0x19(%ebp)
80101bae:	83 c4 10             	add    $0x10,%esp
80101bb1:	e9 22 ff ff ff       	jmp    80101ad8 <consputc.part.0+0x98>
    panic("pos under/overflow");
80101bb6:	83 ec 0c             	sub    $0xc,%esp
80101bb9:	68 96 73 10 80       	push   $0x80107396
80101bbe:	e8 fd fd ff ff       	call   801019c0 <panic>
80101bc3:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80101bca:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80101bd0 <printint>:
{
80101bd0:	55                   	push   %ebp
80101bd1:	89 e5                	mov    %esp,%ebp
80101bd3:	57                   	push   %edi
80101bd4:	56                   	push   %esi
80101bd5:	53                   	push   %ebx
80101bd6:	83 ec 2c             	sub    $0x2c,%esp
80101bd9:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  if(sign && (sign = xx < 0))
80101bdc:	85 c9                	test   %ecx,%ecx
80101bde:	74 04                	je     80101be4 <printint+0x14>
80101be0:	85 c0                	test   %eax,%eax
80101be2:	78 6d                	js     80101c51 <printint+0x81>
    x = xx;
80101be4:	89 c1                	mov    %eax,%ecx
80101be6:	31 f6                	xor    %esi,%esi
  i = 0;
80101be8:	89 75 cc             	mov    %esi,-0x34(%ebp)
80101beb:	31 db                	xor    %ebx,%ebx
80101bed:	8d 7d d7             	lea    -0x29(%ebp),%edi
    buf[i++] = digits[x % base];
80101bf0:	89 c8                	mov    %ecx,%eax
80101bf2:	31 d2                	xor    %edx,%edx
80101bf4:	89 ce                	mov    %ecx,%esi
80101bf6:	f7 75 d4             	divl   -0x2c(%ebp)
80101bf9:	0f b6 92 c4 73 10 80 	movzbl -0x7fef8c3c(%edx),%edx
80101c00:	89 45 d0             	mov    %eax,-0x30(%ebp)
80101c03:	89 d8                	mov    %ebx,%eax
80101c05:	8d 5b 01             	lea    0x1(%ebx),%ebx
  }while((x /= base) != 0);
80101c08:	8b 4d d0             	mov    -0x30(%ebp),%ecx
80101c0b:	89 75 d0             	mov    %esi,-0x30(%ebp)
    buf[i++] = digits[x % base];
80101c0e:	88 14 1f             	mov    %dl,(%edi,%ebx,1)
  }while((x /= base) != 0);
80101c11:	8b 75 d4             	mov    -0x2c(%ebp),%esi
80101c14:	39 75 d0             	cmp    %esi,-0x30(%ebp)
80101c17:	73 d7                	jae    80101bf0 <printint+0x20>
80101c19:	8b 75 cc             	mov    -0x34(%ebp),%esi
  if(sign)
80101c1c:	85 f6                	test   %esi,%esi
80101c1e:	74 0c                	je     80101c2c <printint+0x5c>
    buf[i++] = '-';
80101c20:	c6 44 1d d8 2d       	movb   $0x2d,-0x28(%ebp,%ebx,1)
    buf[i++] = digits[x % base];
80101c25:	89 d8                	mov    %ebx,%eax
    buf[i++] = '-';
80101c27:	ba 2d 00 00 00       	mov    $0x2d,%edx
  while(--i >= 0)
80101c2c:	8d 5c 05 d7          	lea    -0x29(%ebp,%eax,1),%ebx
80101c30:	0f be c2             	movsbl %dl,%eax
  if(panicked){
80101c33:	8b 15 58 98 10 80    	mov    0x80109858,%edx
80101c39:	85 d2                	test   %edx,%edx
80101c3b:	74 03                	je     80101c40 <printint+0x70>
  asm volatile("cli");
80101c3d:	fa                   	cli    
    for(;;)
80101c3e:	eb fe                	jmp    80101c3e <printint+0x6e>
80101c40:	e8 fb fd ff ff       	call   80101a40 <consputc.part.0>
  while(--i >= 0)
80101c45:	39 fb                	cmp    %edi,%ebx
80101c47:	74 10                	je     80101c59 <printint+0x89>
80101c49:	0f be 03             	movsbl (%ebx),%eax
80101c4c:	83 eb 01             	sub    $0x1,%ebx
80101c4f:	eb e2                	jmp    80101c33 <printint+0x63>
    x = -xx;
80101c51:	f7 d8                	neg    %eax
80101c53:	89 ce                	mov    %ecx,%esi
80101c55:	89 c1                	mov    %eax,%ecx
80101c57:	eb 8f                	jmp    80101be8 <printint+0x18>
}
80101c59:	83 c4 2c             	add    $0x2c,%esp
80101c5c:	5b                   	pop    %ebx
80101c5d:	5e                   	pop    %esi
80101c5e:	5f                   	pop    %edi
80101c5f:	5d                   	pop    %ebp
80101c60:	c3                   	ret    
80101c61:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80101c68:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80101c6f:	90                   	nop

80101c70 <consolewrite>:

int
consolewrite(struct inode *ip, char *buf, int n)
{
80101c70:	f3 0f 1e fb          	endbr32 
80101c74:	55                   	push   %ebp
80101c75:	89 e5                	mov    %esp,%ebp
80101c77:	57                   	push   %edi
80101c78:	56                   	push   %esi
80101c79:	53                   	push   %ebx
80101c7a:	83 ec 18             	sub    $0x18,%esp
  int i;

  iunlock(ip);
80101c7d:	ff 75 08             	pushl  0x8(%ebp)
{
80101c80:	8b 5d 10             	mov    0x10(%ebp),%ebx
  iunlock(ip);
80101c83:	e8 48 0d 00 00       	call   801029d0 <iunlock>
  acquire(&cons.lock);
80101c88:	c7 04 24 20 98 10 80 	movl   $0x80109820,(%esp)
80101c8f:	e8 fc e7 ff ff       	call   80100490 <acquire>
  for(i = 0; i < n; i++)
80101c94:	83 c4 10             	add    $0x10,%esp
80101c97:	85 db                	test   %ebx,%ebx
80101c99:	7e 24                	jle    80101cbf <consolewrite+0x4f>
80101c9b:	8b 7d 0c             	mov    0xc(%ebp),%edi
80101c9e:	8d 34 1f             	lea    (%edi,%ebx,1),%esi
  if(panicked){
80101ca1:	8b 15 58 98 10 80    	mov    0x80109858,%edx
80101ca7:	85 d2                	test   %edx,%edx
80101ca9:	74 05                	je     80101cb0 <consolewrite+0x40>
80101cab:	fa                   	cli    
    for(;;)
80101cac:	eb fe                	jmp    80101cac <consolewrite+0x3c>
80101cae:	66 90                	xchg   %ax,%ax
    consputc(buf[i] & 0xff);
80101cb0:	0f b6 07             	movzbl (%edi),%eax
80101cb3:	83 c7 01             	add    $0x1,%edi
80101cb6:	e8 85 fd ff ff       	call   80101a40 <consputc.part.0>
  for(i = 0; i < n; i++)
80101cbb:	39 fe                	cmp    %edi,%esi
80101cbd:	75 e2                	jne    80101ca1 <consolewrite+0x31>
  release(&cons.lock);
80101cbf:	83 ec 0c             	sub    $0xc,%esp
80101cc2:	68 20 98 10 80       	push   $0x80109820
80101cc7:	e8 84 e8 ff ff       	call   80100550 <release>
  ilock(ip);
80101ccc:	58                   	pop    %eax
80101ccd:	ff 75 08             	pushl  0x8(%ebp)
80101cd0:	e8 1b 0c 00 00       	call   801028f0 <ilock>

  return n;
}
80101cd5:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101cd8:	89 d8                	mov    %ebx,%eax
80101cda:	5b                   	pop    %ebx
80101cdb:	5e                   	pop    %esi
80101cdc:	5f                   	pop    %edi
80101cdd:	5d                   	pop    %ebp
80101cde:	c3                   	ret    
80101cdf:	90                   	nop

80101ce0 <cprintf>:
{
80101ce0:	f3 0f 1e fb          	endbr32 
80101ce4:	55                   	push   %ebp
80101ce5:	89 e5                	mov    %esp,%ebp
80101ce7:	57                   	push   %edi
80101ce8:	56                   	push   %esi
80101ce9:	53                   	push   %ebx
80101cea:	83 ec 1c             	sub    $0x1c,%esp
  locking = cons.locking;
80101ced:	a1 54 98 10 80       	mov    0x80109854,%eax
80101cf2:	89 45 e0             	mov    %eax,-0x20(%ebp)
  if(locking)
80101cf5:	85 c0                	test   %eax,%eax
80101cf7:	0f 85 e8 00 00 00    	jne    80101de5 <cprintf+0x105>
  if (fmt == 0)
80101cfd:	8b 45 08             	mov    0x8(%ebp),%eax
80101d00:	89 45 e4             	mov    %eax,-0x1c(%ebp)
80101d03:	85 c0                	test   %eax,%eax
80101d05:	0f 84 5a 01 00 00    	je     80101e65 <cprintf+0x185>
  for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
80101d0b:	0f b6 00             	movzbl (%eax),%eax
80101d0e:	85 c0                	test   %eax,%eax
80101d10:	74 36                	je     80101d48 <cprintf+0x68>
  argp = (uint*)(void*)(&fmt + 1);
80101d12:	8d 5d 0c             	lea    0xc(%ebp),%ebx
  for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
80101d15:	31 f6                	xor    %esi,%esi
    if(c != '%'){
80101d17:	83 f8 25             	cmp    $0x25,%eax
80101d1a:	74 44                	je     80101d60 <cprintf+0x80>
  if(panicked){
80101d1c:	8b 0d 58 98 10 80    	mov    0x80109858,%ecx
80101d22:	85 c9                	test   %ecx,%ecx
80101d24:	74 0f                	je     80101d35 <cprintf+0x55>
80101d26:	fa                   	cli    
    for(;;)
80101d27:	eb fe                	jmp    80101d27 <cprintf+0x47>
80101d29:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80101d30:	b8 25 00 00 00       	mov    $0x25,%eax
80101d35:	e8 06 fd ff ff       	call   80101a40 <consputc.part.0>
  for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
80101d3a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
80101d3d:	83 c6 01             	add    $0x1,%esi
80101d40:	0f b6 04 30          	movzbl (%eax,%esi,1),%eax
80101d44:	85 c0                	test   %eax,%eax
80101d46:	75 cf                	jne    80101d17 <cprintf+0x37>
  if(locking)
80101d48:	8b 45 e0             	mov    -0x20(%ebp),%eax
80101d4b:	85 c0                	test   %eax,%eax
80101d4d:	0f 85 fd 00 00 00    	jne    80101e50 <cprintf+0x170>
}
80101d53:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101d56:	5b                   	pop    %ebx
80101d57:	5e                   	pop    %esi
80101d58:	5f                   	pop    %edi
80101d59:	5d                   	pop    %ebp
80101d5a:	c3                   	ret    
80101d5b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80101d5f:	90                   	nop
    c = fmt[++i] & 0xff;
80101d60:	8b 45 e4             	mov    -0x1c(%ebp),%eax
80101d63:	83 c6 01             	add    $0x1,%esi
80101d66:	0f b6 3c 30          	movzbl (%eax,%esi,1),%edi
    if(c == 0)
80101d6a:	85 ff                	test   %edi,%edi
80101d6c:	74 da                	je     80101d48 <cprintf+0x68>
    switch(c){
80101d6e:	83 ff 70             	cmp    $0x70,%edi
80101d71:	74 5a                	je     80101dcd <cprintf+0xed>
80101d73:	7f 2a                	jg     80101d9f <cprintf+0xbf>
80101d75:	83 ff 25             	cmp    $0x25,%edi
80101d78:	0f 84 92 00 00 00    	je     80101e10 <cprintf+0x130>
80101d7e:	83 ff 64             	cmp    $0x64,%edi
80101d81:	0f 85 a1 00 00 00    	jne    80101e28 <cprintf+0x148>
      printint(*argp++, 10, 1);
80101d87:	8b 03                	mov    (%ebx),%eax
80101d89:	8d 7b 04             	lea    0x4(%ebx),%edi
80101d8c:	b9 01 00 00 00       	mov    $0x1,%ecx
80101d91:	ba 0a 00 00 00       	mov    $0xa,%edx
80101d96:	89 fb                	mov    %edi,%ebx
80101d98:	e8 33 fe ff ff       	call   80101bd0 <printint>
      break;
80101d9d:	eb 9b                	jmp    80101d3a <cprintf+0x5a>
    switch(c){
80101d9f:	83 ff 73             	cmp    $0x73,%edi
80101da2:	75 24                	jne    80101dc8 <cprintf+0xe8>
      if((s = (char*)*argp++) == 0)
80101da4:	8d 7b 04             	lea    0x4(%ebx),%edi
80101da7:	8b 1b                	mov    (%ebx),%ebx
80101da9:	85 db                	test   %ebx,%ebx
80101dab:	75 55                	jne    80101e02 <cprintf+0x122>
        s = "(null)";
80101dad:	bb a9 73 10 80       	mov    $0x801073a9,%ebx
      for(; *s; s++)
80101db2:	b8 28 00 00 00       	mov    $0x28,%eax
  if(panicked){
80101db7:	8b 15 58 98 10 80    	mov    0x80109858,%edx
80101dbd:	85 d2                	test   %edx,%edx
80101dbf:	74 39                	je     80101dfa <cprintf+0x11a>
80101dc1:	fa                   	cli    
    for(;;)
80101dc2:	eb fe                	jmp    80101dc2 <cprintf+0xe2>
80101dc4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    switch(c){
80101dc8:	83 ff 78             	cmp    $0x78,%edi
80101dcb:	75 5b                	jne    80101e28 <cprintf+0x148>
      printint(*argp++, 16, 0);
80101dcd:	8b 03                	mov    (%ebx),%eax
80101dcf:	8d 7b 04             	lea    0x4(%ebx),%edi
80101dd2:	31 c9                	xor    %ecx,%ecx
80101dd4:	ba 10 00 00 00       	mov    $0x10,%edx
80101dd9:	89 fb                	mov    %edi,%ebx
80101ddb:	e8 f0 fd ff ff       	call   80101bd0 <printint>
      break;
80101de0:	e9 55 ff ff ff       	jmp    80101d3a <cprintf+0x5a>
    acquire(&cons.lock);
80101de5:	83 ec 0c             	sub    $0xc,%esp
80101de8:	68 20 98 10 80       	push   $0x80109820
80101ded:	e8 9e e6 ff ff       	call   80100490 <acquire>
80101df2:	83 c4 10             	add    $0x10,%esp
80101df5:	e9 03 ff ff ff       	jmp    80101cfd <cprintf+0x1d>
80101dfa:	e8 41 fc ff ff       	call   80101a40 <consputc.part.0>
      for(; *s; s++)
80101dff:	83 c3 01             	add    $0x1,%ebx
80101e02:	0f be 03             	movsbl (%ebx),%eax
80101e05:	84 c0                	test   %al,%al
80101e07:	75 ae                	jne    80101db7 <cprintf+0xd7>
      if((s = (char*)*argp++) == 0)
80101e09:	89 fb                	mov    %edi,%ebx
80101e0b:	e9 2a ff ff ff       	jmp    80101d3a <cprintf+0x5a>
  if(panicked){
80101e10:	8b 3d 58 98 10 80    	mov    0x80109858,%edi
80101e16:	85 ff                	test   %edi,%edi
80101e18:	0f 84 12 ff ff ff    	je     80101d30 <cprintf+0x50>
80101e1e:	fa                   	cli    
    for(;;)
80101e1f:	eb fe                	jmp    80101e1f <cprintf+0x13f>
80101e21:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  if(panicked){
80101e28:	8b 0d 58 98 10 80    	mov    0x80109858,%ecx
80101e2e:	85 c9                	test   %ecx,%ecx
80101e30:	74 06                	je     80101e38 <cprintf+0x158>
80101e32:	fa                   	cli    
    for(;;)
80101e33:	eb fe                	jmp    80101e33 <cprintf+0x153>
80101e35:	8d 76 00             	lea    0x0(%esi),%esi
80101e38:	b8 25 00 00 00       	mov    $0x25,%eax
80101e3d:	e8 fe fb ff ff       	call   80101a40 <consputc.part.0>
  if(panicked){
80101e42:	8b 15 58 98 10 80    	mov    0x80109858,%edx
80101e48:	85 d2                	test   %edx,%edx
80101e4a:	74 2c                	je     80101e78 <cprintf+0x198>
80101e4c:	fa                   	cli    
    for(;;)
80101e4d:	eb fe                	jmp    80101e4d <cprintf+0x16d>
80101e4f:	90                   	nop
    release(&cons.lock);
80101e50:	83 ec 0c             	sub    $0xc,%esp
80101e53:	68 20 98 10 80       	push   $0x80109820
80101e58:	e8 f3 e6 ff ff       	call   80100550 <release>
80101e5d:	83 c4 10             	add    $0x10,%esp
}
80101e60:	e9 ee fe ff ff       	jmp    80101d53 <cprintf+0x73>
    panic("null fmt");
80101e65:	83 ec 0c             	sub    $0xc,%esp
80101e68:	68 b0 73 10 80       	push   $0x801073b0
80101e6d:	e8 4e fb ff ff       	call   801019c0 <panic>
80101e72:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80101e78:	89 f8                	mov    %edi,%eax
80101e7a:	e8 c1 fb ff ff       	call   80101a40 <consputc.part.0>
80101e7f:	e9 b6 fe ff ff       	jmp    80101d3a <cprintf+0x5a>
80101e84:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80101e8b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80101e8f:	90                   	nop

80101e90 <consoleintr>:
{
80101e90:	f3 0f 1e fb          	endbr32 
80101e94:	55                   	push   %ebp
80101e95:	89 e5                	mov    %esp,%ebp
80101e97:	57                   	push   %edi
80101e98:	56                   	push   %esi
  int c, doprocdump = 0;
80101e99:	31 f6                	xor    %esi,%esi
{
80101e9b:	53                   	push   %ebx
80101e9c:	83 ec 18             	sub    $0x18,%esp
80101e9f:	8b 7d 08             	mov    0x8(%ebp),%edi
  acquire(&cons.lock);
80101ea2:	68 20 98 10 80       	push   $0x80109820
80101ea7:	e8 e4 e5 ff ff       	call   80100490 <acquire>
  while((c = getc()) >= 0){
80101eac:	83 c4 10             	add    $0x10,%esp
80101eaf:	eb 17                	jmp    80101ec8 <consoleintr+0x38>
    switch(c){
80101eb1:	83 fb 08             	cmp    $0x8,%ebx
80101eb4:	0f 84 f6 00 00 00    	je     80101fb0 <consoleintr+0x120>
80101eba:	83 fb 10             	cmp    $0x10,%ebx
80101ebd:	0f 85 15 01 00 00    	jne    80101fd8 <consoleintr+0x148>
80101ec3:	be 01 00 00 00       	mov    $0x1,%esi
  while((c = getc()) >= 0){
80101ec8:	ff d7                	call   *%edi
80101eca:	89 c3                	mov    %eax,%ebx
80101ecc:	85 c0                	test   %eax,%eax
80101ece:	0f 88 23 01 00 00    	js     80101ff7 <consoleintr+0x167>
    switch(c){
80101ed4:	83 fb 15             	cmp    $0x15,%ebx
80101ed7:	74 77                	je     80101f50 <consoleintr+0xc0>
80101ed9:	7e d6                	jle    80101eb1 <consoleintr+0x21>
80101edb:	83 fb 7f             	cmp    $0x7f,%ebx
80101ede:	0f 84 cc 00 00 00    	je     80101fb0 <consoleintr+0x120>
      if(c != 0 && input.e-input.r < INPUT_BUF){
80101ee4:	a1 28 ba 10 80       	mov    0x8010ba28,%eax
80101ee9:	89 c2                	mov    %eax,%edx
80101eeb:	2b 15 20 ba 10 80    	sub    0x8010ba20,%edx
80101ef1:	83 fa 7f             	cmp    $0x7f,%edx
80101ef4:	77 d2                	ja     80101ec8 <consoleintr+0x38>
        c = (c == '\r') ? '\n' : c;
80101ef6:	8d 48 01             	lea    0x1(%eax),%ecx
80101ef9:	8b 15 58 98 10 80    	mov    0x80109858,%edx
80101eff:	83 e0 7f             	and    $0x7f,%eax
        input.buf[input.e++ % INPUT_BUF] = c;
80101f02:	89 0d 28 ba 10 80    	mov    %ecx,0x8010ba28
        c = (c == '\r') ? '\n' : c;
80101f08:	83 fb 0d             	cmp    $0xd,%ebx
80101f0b:	0f 84 02 01 00 00    	je     80102013 <consoleintr+0x183>
        input.buf[input.e++ % INPUT_BUF] = c;
80101f11:	88 98 a0 b9 10 80    	mov    %bl,-0x7fef4660(%eax)
  if(panicked){
80101f17:	85 d2                	test   %edx,%edx
80101f19:	0f 85 ff 00 00 00    	jne    8010201e <consoleintr+0x18e>
80101f1f:	89 d8                	mov    %ebx,%eax
80101f21:	e8 1a fb ff ff       	call   80101a40 <consputc.part.0>
        if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){
80101f26:	83 fb 0a             	cmp    $0xa,%ebx
80101f29:	0f 84 0f 01 00 00    	je     8010203e <consoleintr+0x1ae>
80101f2f:	83 fb 04             	cmp    $0x4,%ebx
80101f32:	0f 84 06 01 00 00    	je     8010203e <consoleintr+0x1ae>
80101f38:	a1 20 ba 10 80       	mov    0x8010ba20,%eax
80101f3d:	83 e8 80             	sub    $0xffffff80,%eax
80101f40:	39 05 28 ba 10 80    	cmp    %eax,0x8010ba28
80101f46:	75 80                	jne    80101ec8 <consoleintr+0x38>
80101f48:	e9 f6 00 00 00       	jmp    80102043 <consoleintr+0x1b3>
80101f4d:	8d 76 00             	lea    0x0(%esi),%esi
      while(input.e != input.w &&
80101f50:	a1 28 ba 10 80       	mov    0x8010ba28,%eax
80101f55:	39 05 24 ba 10 80    	cmp    %eax,0x8010ba24
80101f5b:	0f 84 67 ff ff ff    	je     80101ec8 <consoleintr+0x38>
            input.buf[(input.e-1) % INPUT_BUF] != '\n'){
80101f61:	83 e8 01             	sub    $0x1,%eax
80101f64:	89 c2                	mov    %eax,%edx
80101f66:	83 e2 7f             	and    $0x7f,%edx
      while(input.e != input.w &&
80101f69:	80 ba a0 b9 10 80 0a 	cmpb   $0xa,-0x7fef4660(%edx)
80101f70:	0f 84 52 ff ff ff    	je     80101ec8 <consoleintr+0x38>
  if(panicked){
80101f76:	8b 15 58 98 10 80    	mov    0x80109858,%edx
        input.e--;
80101f7c:	a3 28 ba 10 80       	mov    %eax,0x8010ba28
  if(panicked){
80101f81:	85 d2                	test   %edx,%edx
80101f83:	74 0b                	je     80101f90 <consoleintr+0x100>
80101f85:	fa                   	cli    
    for(;;)
80101f86:	eb fe                	jmp    80101f86 <consoleintr+0xf6>
80101f88:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80101f8f:	90                   	nop
80101f90:	b8 00 01 00 00       	mov    $0x100,%eax
80101f95:	e8 a6 fa ff ff       	call   80101a40 <consputc.part.0>
      while(input.e != input.w &&
80101f9a:	a1 28 ba 10 80       	mov    0x8010ba28,%eax
80101f9f:	3b 05 24 ba 10 80    	cmp    0x8010ba24,%eax
80101fa5:	75 ba                	jne    80101f61 <consoleintr+0xd1>
80101fa7:	e9 1c ff ff ff       	jmp    80101ec8 <consoleintr+0x38>
80101fac:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
      if(input.e != input.w){
80101fb0:	a1 28 ba 10 80       	mov    0x8010ba28,%eax
80101fb5:	3b 05 24 ba 10 80    	cmp    0x8010ba24,%eax
80101fbb:	0f 84 07 ff ff ff    	je     80101ec8 <consoleintr+0x38>
        input.e--;
80101fc1:	83 e8 01             	sub    $0x1,%eax
80101fc4:	a3 28 ba 10 80       	mov    %eax,0x8010ba28
  if(panicked){
80101fc9:	a1 58 98 10 80       	mov    0x80109858,%eax
80101fce:	85 c0                	test   %eax,%eax
80101fd0:	74 16                	je     80101fe8 <consoleintr+0x158>
80101fd2:	fa                   	cli    
    for(;;)
80101fd3:	eb fe                	jmp    80101fd3 <consoleintr+0x143>
80101fd5:	8d 76 00             	lea    0x0(%esi),%esi
      if(c != 0 && input.e-input.r < INPUT_BUF){
80101fd8:	85 db                	test   %ebx,%ebx
80101fda:	0f 84 e8 fe ff ff    	je     80101ec8 <consoleintr+0x38>
80101fe0:	e9 ff fe ff ff       	jmp    80101ee4 <consoleintr+0x54>
80101fe5:	8d 76 00             	lea    0x0(%esi),%esi
80101fe8:	b8 00 01 00 00       	mov    $0x100,%eax
80101fed:	e8 4e fa ff ff       	call   80101a40 <consputc.part.0>
80101ff2:	e9 d1 fe ff ff       	jmp    80101ec8 <consoleintr+0x38>
  release(&cons.lock);
80101ff7:	83 ec 0c             	sub    $0xc,%esp
80101ffa:	68 20 98 10 80       	push   $0x80109820
80101fff:	e8 4c e5 ff ff       	call   80100550 <release>
  if(doprocdump) {
80102004:	83 c4 10             	add    $0x10,%esp
80102007:	85 f6                	test   %esi,%esi
80102009:	75 1d                	jne    80102028 <consoleintr+0x198>
}
8010200b:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010200e:	5b                   	pop    %ebx
8010200f:	5e                   	pop    %esi
80102010:	5f                   	pop    %edi
80102011:	5d                   	pop    %ebp
80102012:	c3                   	ret    
        input.buf[input.e++ % INPUT_BUF] = c;
80102013:	c6 80 a0 b9 10 80 0a 	movb   $0xa,-0x7fef4660(%eax)
  if(panicked){
8010201a:	85 d2                	test   %edx,%edx
8010201c:	74 16                	je     80102034 <consoleintr+0x1a4>
8010201e:	fa                   	cli    
    for(;;)
8010201f:	eb fe                	jmp    8010201f <consoleintr+0x18f>
80102021:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
}
80102028:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010202b:	5b                   	pop    %ebx
8010202c:	5e                   	pop    %esi
8010202d:	5f                   	pop    %edi
8010202e:	5d                   	pop    %ebp
    procdump();  // now call procdump() wo. cons.lock held
8010202f:	e9 ec 21 00 00       	jmp    80104220 <procdump>
80102034:	b8 0a 00 00 00       	mov    $0xa,%eax
80102039:	e8 02 fa ff ff       	call   80101a40 <consputc.part.0>
        if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){
8010203e:	a1 28 ba 10 80       	mov    0x8010ba28,%eax
          wakeup(&input.r);
80102043:	83 ec 0c             	sub    $0xc,%esp
          input.w = input.e;
80102046:	a3 24 ba 10 80       	mov    %eax,0x8010ba24
          wakeup(&input.r);
8010204b:	68 20 ba 10 80       	push   $0x8010ba20
80102050:	e8 cb 20 00 00       	call   80104120 <wakeup>
80102055:	83 c4 10             	add    $0x10,%esp
80102058:	e9 6b fe ff ff       	jmp    80101ec8 <consoleintr+0x38>
8010205d:	8d 76 00             	lea    0x0(%esi),%esi

80102060 <consoleinit>:

void
consoleinit(void)
{
80102060:	f3 0f 1e fb          	endbr32 
80102064:	55                   	push   %ebp
80102065:	89 e5                	mov    %esp,%ebp
80102067:	83 ec 10             	sub    $0x10,%esp
  initlock(&cons.lock, "console");
8010206a:	68 b9 73 10 80       	push   $0x801073b9
8010206f:	68 20 98 10 80       	push   $0x80109820
80102074:	e8 97 e2 ff ff       	call   80100310 <initlock>

  devsw[CONSOLE].write = consolewrite;
  devsw[CONSOLE].read = consoleread;
  cons.locking = 1;

  ioapicenable(IRQ_KBD, 0);
80102079:	58                   	pop    %eax
8010207a:	5a                   	pop    %edx
8010207b:	6a 00                	push   $0x0
8010207d:	6a 01                	push   $0x1
  devsw[CONSOLE].write = consolewrite;
8010207f:	c7 05 4c b9 10 80 70 	movl   $0x80101c70,0x8010b94c
80102086:	1c 10 80 
  devsw[CONSOLE].read = consoleread;
80102089:	c7 05 48 b9 10 80 c0 	movl   $0x801018c0,0x8010b948
80102090:	18 10 80 
  cons.locking = 1;
80102093:	c7 05 54 98 10 80 01 	movl   $0x1,0x80109854
8010209a:	00 00 00 
  ioapicenable(IRQ_KBD, 0);
8010209d:	e8 ce e5 ff ff       	call   80100670 <ioapicenable>
}
801020a2:	83 c4 10             	add    $0x10,%esp
801020a5:	c9                   	leave  
801020a6:	c3                   	ret    
801020a7:	66 90                	xchg   %ax,%ax
801020a9:	66 90                	xchg   %ax,%ax
801020ab:	66 90                	xchg   %ax,%ax
801020ad:	66 90                	xchg   %ax,%ax
801020af:	90                   	nop

801020b0 <kbdgetc>:
#include "defs.h"
#include "kbd.h"

int
kbdgetc(void)
{
801020b0:	f3 0f 1e fb          	endbr32 
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801020b4:	ba 64 00 00 00       	mov    $0x64,%edx
801020b9:	ec                   	in     (%dx),%al
    normalmap, shiftmap, ctlmap, ctlmap
  };
  uint st, data, c;

  st = inb(KBSTATP);
  if((st & KBS_DIB) == 0)
801020ba:	a8 01                	test   $0x1,%al
801020bc:	0f 84 be 00 00 00    	je     80102180 <kbdgetc+0xd0>
{
801020c2:	55                   	push   %ebp
801020c3:	ba 60 00 00 00       	mov    $0x60,%edx
801020c8:	89 e5                	mov    %esp,%ebp
801020ca:	53                   	push   %ebx
801020cb:	ec                   	in     (%dx),%al
  return data;
801020cc:	8b 1d 5c 98 10 80    	mov    0x8010985c,%ebx
    return -1;
  data = inb(KBDATAP);
801020d2:	0f b6 d0             	movzbl %al,%edx

  if(data == 0xE0){
801020d5:	3c e0                	cmp    $0xe0,%al
801020d7:	74 57                	je     80102130 <kbdgetc+0x80>
    shift |= E0ESC;
    return 0;
  } else if(data & 0x80){
801020d9:	89 d9                	mov    %ebx,%ecx
801020db:	83 e1 40             	and    $0x40,%ecx
801020de:	84 c0                	test   %al,%al
801020e0:	78 5e                	js     80102140 <kbdgetc+0x90>
    // Key released
    data = (shift & E0ESC ? data : data & 0x7F);
    shift &= ~(shiftcode[data] | E0ESC);
    return 0;
  } else if(shift & E0ESC){
801020e2:	85 c9                	test   %ecx,%ecx
801020e4:	74 09                	je     801020ef <kbdgetc+0x3f>
    // Last character was an E0 escape; or with 0x80
    data |= 0x80;
801020e6:	83 c8 80             	or     $0xffffff80,%eax
    shift &= ~E0ESC;
801020e9:	83 e3 bf             	and    $0xffffffbf,%ebx
    data |= 0x80;
801020ec:	0f b6 d0             	movzbl %al,%edx
  }

  shift |= shiftcode[data];
801020ef:	0f b6 8a 00 75 10 80 	movzbl -0x7fef8b00(%edx),%ecx
  shift ^= togglecode[data];
801020f6:	0f b6 82 00 74 10 80 	movzbl -0x7fef8c00(%edx),%eax
  shift |= shiftcode[data];
801020fd:	09 d9                	or     %ebx,%ecx
  shift ^= togglecode[data];
801020ff:	31 c1                	xor    %eax,%ecx
  c = charcode[shift & (CTL | SHIFT)][data];
80102101:	89 c8                	mov    %ecx,%eax
  shift ^= togglecode[data];
80102103:	89 0d 5c 98 10 80    	mov    %ecx,0x8010985c
  c = charcode[shift & (CTL | SHIFT)][data];
80102109:	83 e0 03             	and    $0x3,%eax
  if(shift & CAPSLOCK){
8010210c:	83 e1 08             	and    $0x8,%ecx
  c = charcode[shift & (CTL | SHIFT)][data];
8010210f:	8b 04 85 e0 73 10 80 	mov    -0x7fef8c20(,%eax,4),%eax
80102116:	0f b6 04 10          	movzbl (%eax,%edx,1),%eax
  if(shift & CAPSLOCK){
8010211a:	74 0b                	je     80102127 <kbdgetc+0x77>
    if('a' <= c && c <= 'z')
8010211c:	8d 50 9f             	lea    -0x61(%eax),%edx
8010211f:	83 fa 19             	cmp    $0x19,%edx
80102122:	77 44                	ja     80102168 <kbdgetc+0xb8>
      c += 'A' - 'a';
80102124:	83 e8 20             	sub    $0x20,%eax
    else if('A' <= c && c <= 'Z')
      c += 'a' - 'A';
  }
  return c;
}
80102127:	5b                   	pop    %ebx
80102128:	5d                   	pop    %ebp
80102129:	c3                   	ret    
8010212a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    shift |= E0ESC;
80102130:	83 cb 40             	or     $0x40,%ebx
    return 0;
80102133:	31 c0                	xor    %eax,%eax
    shift |= E0ESC;
80102135:	89 1d 5c 98 10 80    	mov    %ebx,0x8010985c
}
8010213b:	5b                   	pop    %ebx
8010213c:	5d                   	pop    %ebp
8010213d:	c3                   	ret    
8010213e:	66 90                	xchg   %ax,%ax
    data = (shift & E0ESC ? data : data & 0x7F);
80102140:	83 e0 7f             	and    $0x7f,%eax
80102143:	85 c9                	test   %ecx,%ecx
80102145:	0f 44 d0             	cmove  %eax,%edx
    return 0;
80102148:	31 c0                	xor    %eax,%eax
    shift &= ~(shiftcode[data] | E0ESC);
8010214a:	0f b6 8a 00 75 10 80 	movzbl -0x7fef8b00(%edx),%ecx
80102151:	83 c9 40             	or     $0x40,%ecx
80102154:	0f b6 c9             	movzbl %cl,%ecx
80102157:	f7 d1                	not    %ecx
80102159:	21 d9                	and    %ebx,%ecx
}
8010215b:	5b                   	pop    %ebx
8010215c:	5d                   	pop    %ebp
    shift &= ~(shiftcode[data] | E0ESC);
8010215d:	89 0d 5c 98 10 80    	mov    %ecx,0x8010985c
}
80102163:	c3                   	ret    
80102164:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    else if('A' <= c && c <= 'Z')
80102168:	8d 48 bf             	lea    -0x41(%eax),%ecx
      c += 'a' - 'A';
8010216b:	8d 50 20             	lea    0x20(%eax),%edx
}
8010216e:	5b                   	pop    %ebx
8010216f:	5d                   	pop    %ebp
      c += 'a' - 'A';
80102170:	83 f9 1a             	cmp    $0x1a,%ecx
80102173:	0f 42 c2             	cmovb  %edx,%eax
}
80102176:	c3                   	ret    
80102177:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010217e:	66 90                	xchg   %ax,%ax
    return -1;
80102180:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80102185:	c3                   	ret    
80102186:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010218d:	8d 76 00             	lea    0x0(%esi),%esi

80102190 <kbdintr>:

void
kbdintr(void)
{
80102190:	f3 0f 1e fb          	endbr32 
80102194:	55                   	push   %ebp
80102195:	89 e5                	mov    %esp,%ebp
80102197:	83 ec 14             	sub    $0x14,%esp
  consoleintr(kbdgetc);
8010219a:	68 b0 20 10 80       	push   $0x801020b0
8010219f:	e8 ec fc ff ff       	call   80101e90 <consoleintr>
}
801021a4:	83 c4 10             	add    $0x10,%esp
801021a7:	c9                   	leave  
801021a8:	c3                   	ret    
801021a9:	66 90                	xchg   %ax,%ax
801021ab:	66 90                	xchg   %ax,%ax
801021ad:	66 90                	xchg   %ax,%ax
801021af:	90                   	nop

801021b0 <uartgetc>:
  outb(COM1+0, c);
}

static int
uartgetc(void)
{
801021b0:	f3 0f 1e fb          	endbr32 
  if(!uart)
801021b4:	a1 60 98 10 80       	mov    0x80109860,%eax
801021b9:	85 c0                	test   %eax,%eax
801021bb:	74 1b                	je     801021d8 <uartgetc+0x28>
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801021bd:	ba fd 03 00 00       	mov    $0x3fd,%edx
801021c2:	ec                   	in     (%dx),%al
    return -1;
  if(!(inb(COM1+5) & 0x01))
801021c3:	a8 01                	test   $0x1,%al
801021c5:	74 11                	je     801021d8 <uartgetc+0x28>
801021c7:	ba f8 03 00 00       	mov    $0x3f8,%edx
801021cc:	ec                   	in     (%dx),%al
    return -1;
  return inb(COM1+0);
801021cd:	0f b6 c0             	movzbl %al,%eax
801021d0:	c3                   	ret    
801021d1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    return -1;
801021d8:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
801021dd:	c3                   	ret    
801021de:	66 90                	xchg   %ax,%ax

801021e0 <uartputc.part.0>:
uartputc(int c)
801021e0:	55                   	push   %ebp
801021e1:	89 e5                	mov    %esp,%ebp
801021e3:	57                   	push   %edi
801021e4:	89 c7                	mov    %eax,%edi
801021e6:	56                   	push   %esi
801021e7:	be fd 03 00 00       	mov    $0x3fd,%esi
801021ec:	53                   	push   %ebx
801021ed:	bb 80 00 00 00       	mov    $0x80,%ebx
801021f2:	83 ec 0c             	sub    $0xc,%esp
801021f5:	eb 1b                	jmp    80102212 <uartputc.part.0+0x32>
801021f7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801021fe:	66 90                	xchg   %ax,%ax
    microdelay(10);
80102200:	83 ec 0c             	sub    $0xc,%esp
80102203:	6a 0a                	push   $0xa
80102205:	e8 e6 e5 ff ff       	call   801007f0 <microdelay>
  for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
8010220a:	83 c4 10             	add    $0x10,%esp
8010220d:	83 eb 01             	sub    $0x1,%ebx
80102210:	74 07                	je     80102219 <uartputc.part.0+0x39>
80102212:	89 f2                	mov    %esi,%edx
80102214:	ec                   	in     (%dx),%al
80102215:	a8 20                	test   $0x20,%al
80102217:	74 e7                	je     80102200 <uartputc.part.0+0x20>
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102219:	ba f8 03 00 00       	mov    $0x3f8,%edx
8010221e:	89 f8                	mov    %edi,%eax
80102220:	ee                   	out    %al,(%dx)
}
80102221:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102224:	5b                   	pop    %ebx
80102225:	5e                   	pop    %esi
80102226:	5f                   	pop    %edi
80102227:	5d                   	pop    %ebp
80102228:	c3                   	ret    
80102229:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80102230 <uartinit>:
{
80102230:	f3 0f 1e fb          	endbr32 
80102234:	55                   	push   %ebp
80102235:	31 c9                	xor    %ecx,%ecx
80102237:	89 c8                	mov    %ecx,%eax
80102239:	89 e5                	mov    %esp,%ebp
8010223b:	57                   	push   %edi
8010223c:	56                   	push   %esi
8010223d:	53                   	push   %ebx
8010223e:	bb fa 03 00 00       	mov    $0x3fa,%ebx
80102243:	89 da                	mov    %ebx,%edx
80102245:	83 ec 0c             	sub    $0xc,%esp
80102248:	ee                   	out    %al,(%dx)
80102249:	bf fb 03 00 00       	mov    $0x3fb,%edi
8010224e:	b8 80 ff ff ff       	mov    $0xffffff80,%eax
80102253:	89 fa                	mov    %edi,%edx
80102255:	ee                   	out    %al,(%dx)
80102256:	b8 0c 00 00 00       	mov    $0xc,%eax
8010225b:	ba f8 03 00 00       	mov    $0x3f8,%edx
80102260:	ee                   	out    %al,(%dx)
80102261:	be f9 03 00 00       	mov    $0x3f9,%esi
80102266:	89 c8                	mov    %ecx,%eax
80102268:	89 f2                	mov    %esi,%edx
8010226a:	ee                   	out    %al,(%dx)
8010226b:	b8 03 00 00 00       	mov    $0x3,%eax
80102270:	89 fa                	mov    %edi,%edx
80102272:	ee                   	out    %al,(%dx)
80102273:	ba fc 03 00 00       	mov    $0x3fc,%edx
80102278:	89 c8                	mov    %ecx,%eax
8010227a:	ee                   	out    %al,(%dx)
8010227b:	b8 01 00 00 00       	mov    $0x1,%eax
80102280:	89 f2                	mov    %esi,%edx
80102282:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102283:	ba fd 03 00 00       	mov    $0x3fd,%edx
80102288:	ec                   	in     (%dx),%al
  if(inb(COM1+5) == 0xFF)
80102289:	3c ff                	cmp    $0xff,%al
8010228b:	74 52                	je     801022df <uartinit+0xaf>
  uart = 1;
8010228d:	c7 05 60 98 10 80 01 	movl   $0x1,0x80109860
80102294:	00 00 00 
80102297:	89 da                	mov    %ebx,%edx
80102299:	ec                   	in     (%dx),%al
8010229a:	ba f8 03 00 00       	mov    $0x3f8,%edx
8010229f:	ec                   	in     (%dx),%al
  ioapicenable(IRQ_COM1, 0);
801022a0:	83 ec 08             	sub    $0x8,%esp
801022a3:	be 76 00 00 00       	mov    $0x76,%esi
  for(p="xv6...\n"; *p; p++)
801022a8:	bb 00 76 10 80       	mov    $0x80107600,%ebx
  ioapicenable(IRQ_COM1, 0);
801022ad:	6a 00                	push   $0x0
801022af:	6a 04                	push   $0x4
801022b1:	e8 ba e3 ff ff       	call   80100670 <ioapicenable>
801022b6:	83 c4 10             	add    $0x10,%esp
  for(p="xv6...\n"; *p; p++)
801022b9:	b8 78 00 00 00       	mov    $0x78,%eax
801022be:	eb 04                	jmp    801022c4 <uartinit+0x94>
801022c0:	0f b6 73 01          	movzbl 0x1(%ebx),%esi
  if(!uart)
801022c4:	8b 15 60 98 10 80    	mov    0x80109860,%edx
801022ca:	85 d2                	test   %edx,%edx
801022cc:	74 08                	je     801022d6 <uartinit+0xa6>
    uartputc(*p);
801022ce:	0f be c0             	movsbl %al,%eax
801022d1:	e8 0a ff ff ff       	call   801021e0 <uartputc.part.0>
  for(p="xv6...\n"; *p; p++)
801022d6:	89 f0                	mov    %esi,%eax
801022d8:	83 c3 01             	add    $0x1,%ebx
801022db:	84 c0                	test   %al,%al
801022dd:	75 e1                	jne    801022c0 <uartinit+0x90>
}
801022df:	8d 65 f4             	lea    -0xc(%ebp),%esp
801022e2:	5b                   	pop    %ebx
801022e3:	5e                   	pop    %esi
801022e4:	5f                   	pop    %edi
801022e5:	5d                   	pop    %ebp
801022e6:	c3                   	ret    
801022e7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801022ee:	66 90                	xchg   %ax,%ax

801022f0 <uartputc>:
{
801022f0:	f3 0f 1e fb          	endbr32 
801022f4:	55                   	push   %ebp
  if(!uart)
801022f5:	8b 15 60 98 10 80    	mov    0x80109860,%edx
{
801022fb:	89 e5                	mov    %esp,%ebp
801022fd:	8b 45 08             	mov    0x8(%ebp),%eax
  if(!uart)
80102300:	85 d2                	test   %edx,%edx
80102302:	74 0c                	je     80102310 <uartputc+0x20>
}
80102304:	5d                   	pop    %ebp
80102305:	e9 d6 fe ff ff       	jmp    801021e0 <uartputc.part.0>
8010230a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80102310:	5d                   	pop    %ebp
80102311:	c3                   	ret    
80102312:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102319:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80102320 <uartintr>:

void
uartintr(void)
{
80102320:	f3 0f 1e fb          	endbr32 
80102324:	55                   	push   %ebp
80102325:	89 e5                	mov    %esp,%ebp
80102327:	83 ec 14             	sub    $0x14,%esp
  consoleintr(uartgetc);
8010232a:	68 b0 21 10 80       	push   $0x801021b0
8010232f:	e8 5c fb ff ff       	call   80101e90 <consoleintr>
}
80102334:	83 c4 10             	add    $0x10,%esp
80102337:	c9                   	leave  
80102338:	c3                   	ret    
80102339:	66 90                	xchg   %ax,%ax
8010233b:	66 90                	xchg   %ax,%ax
8010233d:	66 90                	xchg   %ax,%ax
8010233f:	90                   	nop

80102340 <bfree>:
}

// Free a disk block.
static void
bfree(int dev, uint b)
{
80102340:	55                   	push   %ebp
80102341:	89 c1                	mov    %eax,%ecx
  struct buf *bp;
  int bi, m;

  bp = bread(dev, BBLOCK(b, sb));
80102343:	89 d0                	mov    %edx,%eax
80102345:	c1 e8 0c             	shr    $0xc,%eax
80102348:	03 05 58 ba 10 80    	add    0x8010ba58,%eax
{
8010234e:	89 e5                	mov    %esp,%ebp
80102350:	56                   	push   %esi
80102351:	53                   	push   %ebx
80102352:	89 d3                	mov    %edx,%ebx
  bp = bread(dev, BBLOCK(b, sb));
80102354:	83 ec 08             	sub    $0x8,%esp
80102357:	50                   	push   %eax
80102358:	51                   	push   %ecx
80102359:	e8 32 0f 00 00       	call   80103290 <bread>
  bi = b % BPB;
  m = 1 << (bi % 8);
8010235e:	89 d9                	mov    %ebx,%ecx
  if((bp->data[bi/8] & m) == 0)
80102360:	c1 fb 03             	sar    $0x3,%ebx
  m = 1 << (bi % 8);
80102363:	ba 01 00 00 00       	mov    $0x1,%edx
80102368:	83 e1 07             	and    $0x7,%ecx
  if((bp->data[bi/8] & m) == 0)
8010236b:	81 e3 ff 01 00 00    	and    $0x1ff,%ebx
80102371:	83 c4 10             	add    $0x10,%esp
  m = 1 << (bi % 8);
80102374:	d3 e2                	shl    %cl,%edx
  if((bp->data[bi/8] & m) == 0)
80102376:	0f b6 4c 18 5c       	movzbl 0x5c(%eax,%ebx,1),%ecx
8010237b:	85 d1                	test   %edx,%ecx
8010237d:	74 25                	je     801023a4 <bfree+0x64>
    panic("freeing free block");
  bp->data[bi/8] &= ~m;
8010237f:	f7 d2                	not    %edx
  log_write(bp);
80102381:	83 ec 0c             	sub    $0xc,%esp
80102384:	89 c6                	mov    %eax,%esi
  bp->data[bi/8] &= ~m;
80102386:	21 ca                	and    %ecx,%edx
80102388:	88 54 18 5c          	mov    %dl,0x5c(%eax,%ebx,1)
  log_write(bp);
8010238c:	50                   	push   %eax
8010238d:	e8 ee ec ff ff       	call   80101080 <log_write>
  brelse(bp);
80102392:	89 34 24             	mov    %esi,(%esp)
80102395:	e8 16 10 00 00       	call   801033b0 <brelse>
}
8010239a:	83 c4 10             	add    $0x10,%esp
8010239d:	8d 65 f8             	lea    -0x8(%ebp),%esp
801023a0:	5b                   	pop    %ebx
801023a1:	5e                   	pop    %esi
801023a2:	5d                   	pop    %ebp
801023a3:	c3                   	ret    
    panic("freeing free block");
801023a4:	83 ec 0c             	sub    $0xc,%esp
801023a7:	68 08 76 10 80       	push   $0x80107608
801023ac:	e8 0f f6 ff ff       	call   801019c0 <panic>
801023b1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801023b8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801023bf:	90                   	nop

801023c0 <balloc>:
{
801023c0:	55                   	push   %ebp
801023c1:	89 e5                	mov    %esp,%ebp
801023c3:	57                   	push   %edi
801023c4:	56                   	push   %esi
801023c5:	53                   	push   %ebx
801023c6:	83 ec 1c             	sub    $0x1c,%esp
  for(b = 0; b < sb.size; b += BPB){
801023c9:	8b 0d 40 ba 10 80    	mov    0x8010ba40,%ecx
{
801023cf:	89 45 d8             	mov    %eax,-0x28(%ebp)
  for(b = 0; b < sb.size; b += BPB){
801023d2:	85 c9                	test   %ecx,%ecx
801023d4:	0f 84 87 00 00 00    	je     80102461 <balloc+0xa1>
801023da:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
    bp = bread(dev, BBLOCK(b, sb));
801023e1:	8b 75 dc             	mov    -0x24(%ebp),%esi
801023e4:	83 ec 08             	sub    $0x8,%esp
801023e7:	89 f0                	mov    %esi,%eax
801023e9:	c1 f8 0c             	sar    $0xc,%eax
801023ec:	03 05 58 ba 10 80    	add    0x8010ba58,%eax
801023f2:	50                   	push   %eax
801023f3:	ff 75 d8             	pushl  -0x28(%ebp)
801023f6:	e8 95 0e 00 00       	call   80103290 <bread>
801023fb:	83 c4 10             	add    $0x10,%esp
801023fe:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
80102401:	a1 40 ba 10 80       	mov    0x8010ba40,%eax
80102406:	89 45 e0             	mov    %eax,-0x20(%ebp)
80102409:	31 c0                	xor    %eax,%eax
8010240b:	eb 2f                	jmp    8010243c <balloc+0x7c>
8010240d:	8d 76 00             	lea    0x0(%esi),%esi
      m = 1 << (bi % 8);
80102410:	89 c1                	mov    %eax,%ecx
80102412:	bb 01 00 00 00       	mov    $0x1,%ebx
      if((bp->data[bi/8] & m) == 0){  // Is block free?
80102417:	8b 55 e4             	mov    -0x1c(%ebp),%edx
      m = 1 << (bi % 8);
8010241a:	83 e1 07             	and    $0x7,%ecx
8010241d:	d3 e3                	shl    %cl,%ebx
      if((bp->data[bi/8] & m) == 0){  // Is block free?
8010241f:	89 c1                	mov    %eax,%ecx
80102421:	c1 f9 03             	sar    $0x3,%ecx
80102424:	0f b6 7c 0a 5c       	movzbl 0x5c(%edx,%ecx,1),%edi
80102429:	89 fa                	mov    %edi,%edx
8010242b:	85 df                	test   %ebx,%edi
8010242d:	74 41                	je     80102470 <balloc+0xb0>
    for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
8010242f:	83 c0 01             	add    $0x1,%eax
80102432:	83 c6 01             	add    $0x1,%esi
80102435:	3d 00 10 00 00       	cmp    $0x1000,%eax
8010243a:	74 05                	je     80102441 <balloc+0x81>
8010243c:	39 75 e0             	cmp    %esi,-0x20(%ebp)
8010243f:	77 cf                	ja     80102410 <balloc+0x50>
    brelse(bp);
80102441:	83 ec 0c             	sub    $0xc,%esp
80102444:	ff 75 e4             	pushl  -0x1c(%ebp)
80102447:	e8 64 0f 00 00       	call   801033b0 <brelse>
  for(b = 0; b < sb.size; b += BPB){
8010244c:	81 45 dc 00 10 00 00 	addl   $0x1000,-0x24(%ebp)
80102453:	83 c4 10             	add    $0x10,%esp
80102456:	8b 45 dc             	mov    -0x24(%ebp),%eax
80102459:	39 05 40 ba 10 80    	cmp    %eax,0x8010ba40
8010245f:	77 80                	ja     801023e1 <balloc+0x21>
  panic("balloc: out of blocks");
80102461:	83 ec 0c             	sub    $0xc,%esp
80102464:	68 1b 76 10 80       	push   $0x8010761b
80102469:	e8 52 f5 ff ff       	call   801019c0 <panic>
8010246e:	66 90                	xchg   %ax,%ax
        bp->data[bi/8] |= m;  // Mark block in use.
80102470:	8b 7d e4             	mov    -0x1c(%ebp),%edi
        log_write(bp);
80102473:	83 ec 0c             	sub    $0xc,%esp
        bp->data[bi/8] |= m;  // Mark block in use.
80102476:	09 da                	or     %ebx,%edx
80102478:	88 54 0f 5c          	mov    %dl,0x5c(%edi,%ecx,1)
        log_write(bp);
8010247c:	57                   	push   %edi
8010247d:	e8 fe eb ff ff       	call   80101080 <log_write>
        brelse(bp);
80102482:	89 3c 24             	mov    %edi,(%esp)
80102485:	e8 26 0f 00 00       	call   801033b0 <brelse>
  bp = bread(dev, bno);
8010248a:	58                   	pop    %eax
8010248b:	5a                   	pop    %edx
8010248c:	56                   	push   %esi
8010248d:	ff 75 d8             	pushl  -0x28(%ebp)
80102490:	e8 fb 0d 00 00       	call   80103290 <bread>
  memset(bp->data, 0, BSIZE);
80102495:	83 c4 0c             	add    $0xc,%esp
  bp = bread(dev, bno);
80102498:	89 c3                	mov    %eax,%ebx
  memset(bp->data, 0, BSIZE);
8010249a:	8d 40 5c             	lea    0x5c(%eax),%eax
8010249d:	68 00 02 00 00       	push   $0x200
801024a2:	6a 00                	push   $0x0
801024a4:	50                   	push   %eax
801024a5:	e8 26 2d 00 00       	call   801051d0 <memset>
  log_write(bp);
801024aa:	89 1c 24             	mov    %ebx,(%esp)
801024ad:	e8 ce eb ff ff       	call   80101080 <log_write>
  brelse(bp);
801024b2:	89 1c 24             	mov    %ebx,(%esp)
801024b5:	e8 f6 0e 00 00       	call   801033b0 <brelse>
}
801024ba:	8d 65 f4             	lea    -0xc(%ebp),%esp
801024bd:	89 f0                	mov    %esi,%eax
801024bf:	5b                   	pop    %ebx
801024c0:	5e                   	pop    %esi
801024c1:	5f                   	pop    %edi
801024c2:	5d                   	pop    %ebp
801024c3:	c3                   	ret    
801024c4:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801024cb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801024cf:	90                   	nop

801024d0 <iget>:
// Find the inode with number inum on device dev
// and return the in-memory copy. Does not lock
// the inode and does not read it from disk.
static struct inode*
iget(uint dev, uint inum)
{
801024d0:	55                   	push   %ebp
801024d1:	89 e5                	mov    %esp,%ebp
801024d3:	57                   	push   %edi
801024d4:	89 c7                	mov    %eax,%edi
801024d6:	56                   	push   %esi
  struct inode *ip, *empty;

  acquire(&icache.lock);

  // Is the inode already cached?
  empty = 0;
801024d7:	31 f6                	xor    %esi,%esi
{
801024d9:	53                   	push   %ebx
  for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
801024da:	bb 94 ba 10 80       	mov    $0x8010ba94,%ebx
{
801024df:	83 ec 28             	sub    $0x28,%esp
801024e2:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  acquire(&icache.lock);
801024e5:	68 60 ba 10 80       	push   $0x8010ba60
801024ea:	e8 a1 df ff ff       	call   80100490 <acquire>
  for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
801024ef:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  acquire(&icache.lock);
801024f2:	83 c4 10             	add    $0x10,%esp
801024f5:	eb 1b                	jmp    80102512 <iget+0x42>
801024f7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801024fe:	66 90                	xchg   %ax,%ax
    if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
80102500:	39 3b                	cmp    %edi,(%ebx)
80102502:	74 6c                	je     80102570 <iget+0xa0>
80102504:	81 c3 90 00 00 00    	add    $0x90,%ebx
  for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
8010250a:	81 fb b4 d6 10 80    	cmp    $0x8010d6b4,%ebx
80102510:	73 26                	jae    80102538 <iget+0x68>
    if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
80102512:	8b 4b 08             	mov    0x8(%ebx),%ecx
80102515:	85 c9                	test   %ecx,%ecx
80102517:	7f e7                	jg     80102500 <iget+0x30>
      ip->ref++;
      release(&icache.lock);
      return ip;
    }
    if(empty == 0 && ip->ref == 0)    // Remember empty slot.
80102519:	85 f6                	test   %esi,%esi
8010251b:	75 e7                	jne    80102504 <iget+0x34>
8010251d:	89 d8                	mov    %ebx,%eax
8010251f:	81 c3 90 00 00 00    	add    $0x90,%ebx
80102525:	85 c9                	test   %ecx,%ecx
80102527:	75 6e                	jne    80102597 <iget+0xc7>
80102529:	89 c6                	mov    %eax,%esi
  for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
8010252b:	81 fb b4 d6 10 80    	cmp    $0x8010d6b4,%ebx
80102531:	72 df                	jb     80102512 <iget+0x42>
80102533:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80102537:	90                   	nop
      empty = ip;
  }

  // Recycle an inode cache entry.
  if(empty == 0)
80102538:	85 f6                	test   %esi,%esi
8010253a:	74 73                	je     801025af <iget+0xdf>
  ip = empty;
  ip->dev = dev;
  ip->inum = inum;
  ip->ref = 1;
  ip->valid = 0;
  release(&icache.lock);
8010253c:	83 ec 0c             	sub    $0xc,%esp
  ip->dev = dev;
8010253f:	89 3e                	mov    %edi,(%esi)
  ip->inum = inum;
80102541:	89 56 04             	mov    %edx,0x4(%esi)
  ip->ref = 1;
80102544:	c7 46 08 01 00 00 00 	movl   $0x1,0x8(%esi)
  ip->valid = 0;
8010254b:	c7 46 4c 00 00 00 00 	movl   $0x0,0x4c(%esi)
  release(&icache.lock);
80102552:	68 60 ba 10 80       	push   $0x8010ba60
80102557:	e8 f4 df ff ff       	call   80100550 <release>

  return ip;
8010255c:	83 c4 10             	add    $0x10,%esp
}
8010255f:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102562:	89 f0                	mov    %esi,%eax
80102564:	5b                   	pop    %ebx
80102565:	5e                   	pop    %esi
80102566:	5f                   	pop    %edi
80102567:	5d                   	pop    %ebp
80102568:	c3                   	ret    
80102569:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
80102570:	39 53 04             	cmp    %edx,0x4(%ebx)
80102573:	75 8f                	jne    80102504 <iget+0x34>
      release(&icache.lock);
80102575:	83 ec 0c             	sub    $0xc,%esp
      ip->ref++;
80102578:	83 c1 01             	add    $0x1,%ecx
      return ip;
8010257b:	89 de                	mov    %ebx,%esi
      release(&icache.lock);
8010257d:	68 60 ba 10 80       	push   $0x8010ba60
      ip->ref++;
80102582:	89 4b 08             	mov    %ecx,0x8(%ebx)
      release(&icache.lock);
80102585:	e8 c6 df ff ff       	call   80100550 <release>
      return ip;
8010258a:	83 c4 10             	add    $0x10,%esp
}
8010258d:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102590:	89 f0                	mov    %esi,%eax
80102592:	5b                   	pop    %ebx
80102593:	5e                   	pop    %esi
80102594:	5f                   	pop    %edi
80102595:	5d                   	pop    %ebp
80102596:	c3                   	ret    
  for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
80102597:	81 fb b4 d6 10 80    	cmp    $0x8010d6b4,%ebx
8010259d:	73 10                	jae    801025af <iget+0xdf>
    if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
8010259f:	8b 4b 08             	mov    0x8(%ebx),%ecx
801025a2:	85 c9                	test   %ecx,%ecx
801025a4:	0f 8f 56 ff ff ff    	jg     80102500 <iget+0x30>
801025aa:	e9 6e ff ff ff       	jmp    8010251d <iget+0x4d>
    panic("iget: no inodes");
801025af:	83 ec 0c             	sub    $0xc,%esp
801025b2:	68 31 76 10 80       	push   $0x80107631
801025b7:	e8 04 f4 ff ff       	call   801019c0 <panic>
801025bc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

801025c0 <bmap>:

// Return the disk block address of the nth block in inode ip.
// If there is no such block, bmap allocates one.
static uint
bmap(struct inode *ip, uint bn)
{
801025c0:	55                   	push   %ebp
801025c1:	89 e5                	mov    %esp,%ebp
801025c3:	57                   	push   %edi
801025c4:	56                   	push   %esi
801025c5:	89 c6                	mov    %eax,%esi
801025c7:	53                   	push   %ebx
801025c8:	83 ec 1c             	sub    $0x1c,%esp
  uint addr, *a;
  struct buf *bp;

  if(bn < NDIRECT){
801025cb:	83 fa 0b             	cmp    $0xb,%edx
801025ce:	0f 86 84 00 00 00    	jbe    80102658 <bmap+0x98>
    if((addr = ip->addrs[bn]) == 0)
      ip->addrs[bn] = addr = balloc(ip->dev);
    return addr;
  }
  bn -= NDIRECT;
801025d4:	8d 5a f4             	lea    -0xc(%edx),%ebx

  if(bn < NINDIRECT){
801025d7:	83 fb 7f             	cmp    $0x7f,%ebx
801025da:	0f 87 98 00 00 00    	ja     80102678 <bmap+0xb8>
    // Load indirect block, allocating if necessary.
    if((addr = ip->addrs[NDIRECT]) == 0)
801025e0:	8b 80 8c 00 00 00    	mov    0x8c(%eax),%eax
801025e6:	8b 16                	mov    (%esi),%edx
801025e8:	85 c0                	test   %eax,%eax
801025ea:	74 54                	je     80102640 <bmap+0x80>
      ip->addrs[NDIRECT] = addr = balloc(ip->dev);
    bp = bread(ip->dev, addr);
801025ec:	83 ec 08             	sub    $0x8,%esp
801025ef:	50                   	push   %eax
801025f0:	52                   	push   %edx
801025f1:	e8 9a 0c 00 00       	call   80103290 <bread>
    a = (uint*)bp->data;
    if((addr = a[bn]) == 0){
801025f6:	83 c4 10             	add    $0x10,%esp
801025f9:	8d 54 98 5c          	lea    0x5c(%eax,%ebx,4),%edx
    bp = bread(ip->dev, addr);
801025fd:	89 c7                	mov    %eax,%edi
    if((addr = a[bn]) == 0){
801025ff:	8b 1a                	mov    (%edx),%ebx
80102601:	85 db                	test   %ebx,%ebx
80102603:	74 1b                	je     80102620 <bmap+0x60>
      a[bn] = addr = balloc(ip->dev);
      log_write(bp);
    }
    brelse(bp);
80102605:	83 ec 0c             	sub    $0xc,%esp
80102608:	57                   	push   %edi
80102609:	e8 a2 0d 00 00       	call   801033b0 <brelse>
    return addr;
8010260e:	83 c4 10             	add    $0x10,%esp
  }

  panic("bmap: out of range");
}
80102611:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102614:	89 d8                	mov    %ebx,%eax
80102616:	5b                   	pop    %ebx
80102617:	5e                   	pop    %esi
80102618:	5f                   	pop    %edi
80102619:	5d                   	pop    %ebp
8010261a:	c3                   	ret    
8010261b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010261f:	90                   	nop
      a[bn] = addr = balloc(ip->dev);
80102620:	8b 06                	mov    (%esi),%eax
80102622:	89 55 e4             	mov    %edx,-0x1c(%ebp)
80102625:	e8 96 fd ff ff       	call   801023c0 <balloc>
8010262a:	8b 55 e4             	mov    -0x1c(%ebp),%edx
      log_write(bp);
8010262d:	83 ec 0c             	sub    $0xc,%esp
      a[bn] = addr = balloc(ip->dev);
80102630:	89 c3                	mov    %eax,%ebx
80102632:	89 02                	mov    %eax,(%edx)
      log_write(bp);
80102634:	57                   	push   %edi
80102635:	e8 46 ea ff ff       	call   80101080 <log_write>
8010263a:	83 c4 10             	add    $0x10,%esp
8010263d:	eb c6                	jmp    80102605 <bmap+0x45>
8010263f:	90                   	nop
      ip->addrs[NDIRECT] = addr = balloc(ip->dev);
80102640:	89 d0                	mov    %edx,%eax
80102642:	e8 79 fd ff ff       	call   801023c0 <balloc>
80102647:	8b 16                	mov    (%esi),%edx
80102649:	89 86 8c 00 00 00    	mov    %eax,0x8c(%esi)
8010264f:	eb 9b                	jmp    801025ec <bmap+0x2c>
80102651:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    if((addr = ip->addrs[bn]) == 0)
80102658:	8d 3c 90             	lea    (%eax,%edx,4),%edi
8010265b:	8b 5f 5c             	mov    0x5c(%edi),%ebx
8010265e:	85 db                	test   %ebx,%ebx
80102660:	75 af                	jne    80102611 <bmap+0x51>
      ip->addrs[bn] = addr = balloc(ip->dev);
80102662:	8b 00                	mov    (%eax),%eax
80102664:	e8 57 fd ff ff       	call   801023c0 <balloc>
80102669:	89 47 5c             	mov    %eax,0x5c(%edi)
8010266c:	89 c3                	mov    %eax,%ebx
}
8010266e:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102671:	89 d8                	mov    %ebx,%eax
80102673:	5b                   	pop    %ebx
80102674:	5e                   	pop    %esi
80102675:	5f                   	pop    %edi
80102676:	5d                   	pop    %ebp
80102677:	c3                   	ret    
  panic("bmap: out of range");
80102678:	83 ec 0c             	sub    $0xc,%esp
8010267b:	68 41 76 10 80       	push   $0x80107641
80102680:	e8 3b f3 ff ff       	call   801019c0 <panic>
80102685:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010268c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80102690 <readsb>:
{
80102690:	f3 0f 1e fb          	endbr32 
80102694:	55                   	push   %ebp
80102695:	89 e5                	mov    %esp,%ebp
80102697:	56                   	push   %esi
80102698:	53                   	push   %ebx
80102699:	8b 75 0c             	mov    0xc(%ebp),%esi
  bp = bread(dev, 1);
8010269c:	83 ec 08             	sub    $0x8,%esp
8010269f:	6a 01                	push   $0x1
801026a1:	ff 75 08             	pushl  0x8(%ebp)
801026a4:	e8 e7 0b 00 00       	call   80103290 <bread>
  memmove(sb, bp->data, sizeof(*sb));
801026a9:	83 c4 0c             	add    $0xc,%esp
  bp = bread(dev, 1);
801026ac:	89 c3                	mov    %eax,%ebx
  memmove(sb, bp->data, sizeof(*sb));
801026ae:	8d 40 5c             	lea    0x5c(%eax),%eax
801026b1:	6a 1c                	push   $0x1c
801026b3:	50                   	push   %eax
801026b4:	56                   	push   %esi
801026b5:	e8 b6 2b 00 00       	call   80105270 <memmove>
  brelse(bp);
801026ba:	89 5d 08             	mov    %ebx,0x8(%ebp)
801026bd:	83 c4 10             	add    $0x10,%esp
}
801026c0:	8d 65 f8             	lea    -0x8(%ebp),%esp
801026c3:	5b                   	pop    %ebx
801026c4:	5e                   	pop    %esi
801026c5:	5d                   	pop    %ebp
  brelse(bp);
801026c6:	e9 e5 0c 00 00       	jmp    801033b0 <brelse>
801026cb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801026cf:	90                   	nop

801026d0 <iinit>:
{
801026d0:	f3 0f 1e fb          	endbr32 
801026d4:	55                   	push   %ebp
801026d5:	89 e5                	mov    %esp,%ebp
801026d7:	53                   	push   %ebx
801026d8:	bb a0 ba 10 80       	mov    $0x8010baa0,%ebx
801026dd:	83 ec 0c             	sub    $0xc,%esp
  initlock(&icache.lock, "icache");
801026e0:	68 54 76 10 80       	push   $0x80107654
801026e5:	68 60 ba 10 80       	push   $0x8010ba60
801026ea:	e8 21 dc ff ff       	call   80100310 <initlock>
  for(i = 0; i < NINODE; i++) {
801026ef:	83 c4 10             	add    $0x10,%esp
801026f2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    initsleeplock(&icache.inode[i].lock, "inode");
801026f8:	83 ec 08             	sub    $0x8,%esp
801026fb:	68 5b 76 10 80       	push   $0x8010765b
80102700:	53                   	push   %ebx
80102701:	81 c3 90 00 00 00    	add    $0x90,%ebx
80102707:	e8 c4 da ff ff       	call   801001d0 <initsleeplock>
  for(i = 0; i < NINODE; i++) {
8010270c:	83 c4 10             	add    $0x10,%esp
8010270f:	81 fb c0 d6 10 80    	cmp    $0x8010d6c0,%ebx
80102715:	75 e1                	jne    801026f8 <iinit+0x28>
  readsb(dev, &sb);
80102717:	83 ec 08             	sub    $0x8,%esp
8010271a:	68 40 ba 10 80       	push   $0x8010ba40
8010271f:	ff 75 08             	pushl  0x8(%ebp)
80102722:	e8 69 ff ff ff       	call   80102690 <readsb>
  cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\
80102727:	ff 35 58 ba 10 80    	pushl  0x8010ba58
8010272d:	ff 35 54 ba 10 80    	pushl  0x8010ba54
80102733:	ff 35 50 ba 10 80    	pushl  0x8010ba50
80102739:	ff 35 4c ba 10 80    	pushl  0x8010ba4c
8010273f:	ff 35 48 ba 10 80    	pushl  0x8010ba48
80102745:	ff 35 44 ba 10 80    	pushl  0x8010ba44
8010274b:	ff 35 40 ba 10 80    	pushl  0x8010ba40
80102751:	68 c0 76 10 80       	push   $0x801076c0
80102756:	e8 85 f5 ff ff       	call   80101ce0 <cprintf>
}
8010275b:	8b 5d fc             	mov    -0x4(%ebp),%ebx
8010275e:	83 c4 30             	add    $0x30,%esp
80102761:	c9                   	leave  
80102762:	c3                   	ret    
80102763:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010276a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80102770 <ialloc>:
{
80102770:	f3 0f 1e fb          	endbr32 
80102774:	55                   	push   %ebp
80102775:	89 e5                	mov    %esp,%ebp
80102777:	57                   	push   %edi
80102778:	56                   	push   %esi
80102779:	53                   	push   %ebx
8010277a:	83 ec 1c             	sub    $0x1c,%esp
8010277d:	8b 45 0c             	mov    0xc(%ebp),%eax
  for(inum = 1; inum < sb.ninodes; inum++){
80102780:	83 3d 48 ba 10 80 01 	cmpl   $0x1,0x8010ba48
{
80102787:	8b 75 08             	mov    0x8(%ebp),%esi
8010278a:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  for(inum = 1; inum < sb.ninodes; inum++){
8010278d:	0f 86 8d 00 00 00    	jbe    80102820 <ialloc+0xb0>
80102793:	bf 01 00 00 00       	mov    $0x1,%edi
80102798:	eb 1d                	jmp    801027b7 <ialloc+0x47>
8010279a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    brelse(bp);
801027a0:	83 ec 0c             	sub    $0xc,%esp
  for(inum = 1; inum < sb.ninodes; inum++){
801027a3:	83 c7 01             	add    $0x1,%edi
    brelse(bp);
801027a6:	53                   	push   %ebx
801027a7:	e8 04 0c 00 00       	call   801033b0 <brelse>
  for(inum = 1; inum < sb.ninodes; inum++){
801027ac:	83 c4 10             	add    $0x10,%esp
801027af:	3b 3d 48 ba 10 80    	cmp    0x8010ba48,%edi
801027b5:	73 69                	jae    80102820 <ialloc+0xb0>
    bp = bread(dev, IBLOCK(inum, sb));
801027b7:	89 f8                	mov    %edi,%eax
801027b9:	83 ec 08             	sub    $0x8,%esp
801027bc:	c1 e8 03             	shr    $0x3,%eax
801027bf:	03 05 54 ba 10 80    	add    0x8010ba54,%eax
801027c5:	50                   	push   %eax
801027c6:	56                   	push   %esi
801027c7:	e8 c4 0a 00 00       	call   80103290 <bread>
    if(dip->type == 0){  // a free inode
801027cc:	83 c4 10             	add    $0x10,%esp
    bp = bread(dev, IBLOCK(inum, sb));
801027cf:	89 c3                	mov    %eax,%ebx
    dip = (struct dinode*)bp->data + inum%IPB;
801027d1:	89 f8                	mov    %edi,%eax
801027d3:	83 e0 07             	and    $0x7,%eax
801027d6:	c1 e0 06             	shl    $0x6,%eax
801027d9:	8d 4c 03 5c          	lea    0x5c(%ebx,%eax,1),%ecx
    if(dip->type == 0){  // a free inode
801027dd:	66 83 39 00          	cmpw   $0x0,(%ecx)
801027e1:	75 bd                	jne    801027a0 <ialloc+0x30>
      memset(dip, 0, sizeof(*dip));
801027e3:	83 ec 04             	sub    $0x4,%esp
801027e6:	89 4d e0             	mov    %ecx,-0x20(%ebp)
801027e9:	6a 40                	push   $0x40
801027eb:	6a 00                	push   $0x0
801027ed:	51                   	push   %ecx
801027ee:	e8 dd 29 00 00       	call   801051d0 <memset>
      dip->type = type;
801027f3:	0f b7 45 e4          	movzwl -0x1c(%ebp),%eax
801027f7:	8b 4d e0             	mov    -0x20(%ebp),%ecx
801027fa:	66 89 01             	mov    %ax,(%ecx)
      log_write(bp);   // mark it allocated on the disk
801027fd:	89 1c 24             	mov    %ebx,(%esp)
80102800:	e8 7b e8 ff ff       	call   80101080 <log_write>
      brelse(bp);
80102805:	89 1c 24             	mov    %ebx,(%esp)
80102808:	e8 a3 0b 00 00       	call   801033b0 <brelse>
      return iget(dev, inum);
8010280d:	83 c4 10             	add    $0x10,%esp
}
80102810:	8d 65 f4             	lea    -0xc(%ebp),%esp
      return iget(dev, inum);
80102813:	89 fa                	mov    %edi,%edx
}
80102815:	5b                   	pop    %ebx
      return iget(dev, inum);
80102816:	89 f0                	mov    %esi,%eax
}
80102818:	5e                   	pop    %esi
80102819:	5f                   	pop    %edi
8010281a:	5d                   	pop    %ebp
      return iget(dev, inum);
8010281b:	e9 b0 fc ff ff       	jmp    801024d0 <iget>
  panic("ialloc: no inodes");
80102820:	83 ec 0c             	sub    $0xc,%esp
80102823:	68 61 76 10 80       	push   $0x80107661
80102828:	e8 93 f1 ff ff       	call   801019c0 <panic>
8010282d:	8d 76 00             	lea    0x0(%esi),%esi

80102830 <iupdate>:
{
80102830:	f3 0f 1e fb          	endbr32 
80102834:	55                   	push   %ebp
80102835:	89 e5                	mov    %esp,%ebp
80102837:	56                   	push   %esi
80102838:	53                   	push   %ebx
80102839:	8b 5d 08             	mov    0x8(%ebp),%ebx
  bp = bread(ip->dev, IBLOCK(ip->inum, sb));
8010283c:	8b 43 04             	mov    0x4(%ebx),%eax
  memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
8010283f:	83 c3 5c             	add    $0x5c,%ebx
  bp = bread(ip->dev, IBLOCK(ip->inum, sb));
80102842:	83 ec 08             	sub    $0x8,%esp
80102845:	c1 e8 03             	shr    $0x3,%eax
80102848:	03 05 54 ba 10 80    	add    0x8010ba54,%eax
8010284e:	50                   	push   %eax
8010284f:	ff 73 a4             	pushl  -0x5c(%ebx)
80102852:	e8 39 0a 00 00       	call   80103290 <bread>
  dip->type = ip->type;
80102857:	0f b7 53 f4          	movzwl -0xc(%ebx),%edx
  memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
8010285b:	83 c4 0c             	add    $0xc,%esp
  bp = bread(ip->dev, IBLOCK(ip->inum, sb));
8010285e:	89 c6                	mov    %eax,%esi
  dip = (struct dinode*)bp->data + ip->inum%IPB;
80102860:	8b 43 a8             	mov    -0x58(%ebx),%eax
80102863:	83 e0 07             	and    $0x7,%eax
80102866:	c1 e0 06             	shl    $0x6,%eax
80102869:	8d 44 06 5c          	lea    0x5c(%esi,%eax,1),%eax
  dip->type = ip->type;
8010286d:	66 89 10             	mov    %dx,(%eax)
  dip->major = ip->major;
80102870:	0f b7 53 f6          	movzwl -0xa(%ebx),%edx
  memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
80102874:	83 c0 0c             	add    $0xc,%eax
  dip->major = ip->major;
80102877:	66 89 50 f6          	mov    %dx,-0xa(%eax)
  dip->minor = ip->minor;
8010287b:	0f b7 53 f8          	movzwl -0x8(%ebx),%edx
8010287f:	66 89 50 f8          	mov    %dx,-0x8(%eax)
  dip->nlink = ip->nlink;
80102883:	0f b7 53 fa          	movzwl -0x6(%ebx),%edx
80102887:	66 89 50 fa          	mov    %dx,-0x6(%eax)
  dip->size = ip->size;
8010288b:	8b 53 fc             	mov    -0x4(%ebx),%edx
8010288e:	89 50 fc             	mov    %edx,-0x4(%eax)
  memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
80102891:	6a 34                	push   $0x34
80102893:	53                   	push   %ebx
80102894:	50                   	push   %eax
80102895:	e8 d6 29 00 00       	call   80105270 <memmove>
  log_write(bp);
8010289a:	89 34 24             	mov    %esi,(%esp)
8010289d:	e8 de e7 ff ff       	call   80101080 <log_write>
  brelse(bp);
801028a2:	89 75 08             	mov    %esi,0x8(%ebp)
801028a5:	83 c4 10             	add    $0x10,%esp
}
801028a8:	8d 65 f8             	lea    -0x8(%ebp),%esp
801028ab:	5b                   	pop    %ebx
801028ac:	5e                   	pop    %esi
801028ad:	5d                   	pop    %ebp
  brelse(bp);
801028ae:	e9 fd 0a 00 00       	jmp    801033b0 <brelse>
801028b3:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801028ba:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801028c0 <idup>:
{
801028c0:	f3 0f 1e fb          	endbr32 
801028c4:	55                   	push   %ebp
801028c5:	89 e5                	mov    %esp,%ebp
801028c7:	53                   	push   %ebx
801028c8:	83 ec 10             	sub    $0x10,%esp
801028cb:	8b 5d 08             	mov    0x8(%ebp),%ebx
  acquire(&icache.lock);
801028ce:	68 60 ba 10 80       	push   $0x8010ba60
801028d3:	e8 b8 db ff ff       	call   80100490 <acquire>
  ip->ref++;
801028d8:	83 43 08 01          	addl   $0x1,0x8(%ebx)
  release(&icache.lock);
801028dc:	c7 04 24 60 ba 10 80 	movl   $0x8010ba60,(%esp)
801028e3:	e8 68 dc ff ff       	call   80100550 <release>
}
801028e8:	89 d8                	mov    %ebx,%eax
801028ea:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801028ed:	c9                   	leave  
801028ee:	c3                   	ret    
801028ef:	90                   	nop

801028f0 <ilock>:
{
801028f0:	f3 0f 1e fb          	endbr32 
801028f4:	55                   	push   %ebp
801028f5:	89 e5                	mov    %esp,%ebp
801028f7:	56                   	push   %esi
801028f8:	53                   	push   %ebx
801028f9:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if(ip == 0 || ip->ref < 1)
801028fc:	85 db                	test   %ebx,%ebx
801028fe:	0f 84 b3 00 00 00    	je     801029b7 <ilock+0xc7>
80102904:	8b 53 08             	mov    0x8(%ebx),%edx
80102907:	85 d2                	test   %edx,%edx
80102909:	0f 8e a8 00 00 00    	jle    801029b7 <ilock+0xc7>
  acquiresleep(&ip->lock);
8010290f:	83 ec 0c             	sub    $0xc,%esp
80102912:	8d 43 0c             	lea    0xc(%ebx),%eax
80102915:	50                   	push   %eax
80102916:	e8 f5 d8 ff ff       	call   80100210 <acquiresleep>
  if(ip->valid == 0){
8010291b:	8b 43 4c             	mov    0x4c(%ebx),%eax
8010291e:	83 c4 10             	add    $0x10,%esp
80102921:	85 c0                	test   %eax,%eax
80102923:	74 0b                	je     80102930 <ilock+0x40>
}
80102925:	8d 65 f8             	lea    -0x8(%ebp),%esp
80102928:	5b                   	pop    %ebx
80102929:	5e                   	pop    %esi
8010292a:	5d                   	pop    %ebp
8010292b:	c3                   	ret    
8010292c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    bp = bread(ip->dev, IBLOCK(ip->inum, sb));
80102930:	8b 43 04             	mov    0x4(%ebx),%eax
80102933:	83 ec 08             	sub    $0x8,%esp
80102936:	c1 e8 03             	shr    $0x3,%eax
80102939:	03 05 54 ba 10 80    	add    0x8010ba54,%eax
8010293f:	50                   	push   %eax
80102940:	ff 33                	pushl  (%ebx)
80102942:	e8 49 09 00 00       	call   80103290 <bread>
    memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
80102947:	83 c4 0c             	add    $0xc,%esp
    bp = bread(ip->dev, IBLOCK(ip->inum, sb));
8010294a:	89 c6                	mov    %eax,%esi
    dip = (struct dinode*)bp->data + ip->inum%IPB;
8010294c:	8b 43 04             	mov    0x4(%ebx),%eax
8010294f:	83 e0 07             	and    $0x7,%eax
80102952:	c1 e0 06             	shl    $0x6,%eax
80102955:	8d 44 06 5c          	lea    0x5c(%esi,%eax,1),%eax
    ip->type = dip->type;
80102959:	0f b7 10             	movzwl (%eax),%edx
    memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
8010295c:	83 c0 0c             	add    $0xc,%eax
    ip->type = dip->type;
8010295f:	66 89 53 50          	mov    %dx,0x50(%ebx)
    ip->major = dip->major;
80102963:	0f b7 50 f6          	movzwl -0xa(%eax),%edx
80102967:	66 89 53 52          	mov    %dx,0x52(%ebx)
    ip->minor = dip->minor;
8010296b:	0f b7 50 f8          	movzwl -0x8(%eax),%edx
8010296f:	66 89 53 54          	mov    %dx,0x54(%ebx)
    ip->nlink = dip->nlink;
80102973:	0f b7 50 fa          	movzwl -0x6(%eax),%edx
80102977:	66 89 53 56          	mov    %dx,0x56(%ebx)
    ip->size = dip->size;
8010297b:	8b 50 fc             	mov    -0x4(%eax),%edx
8010297e:	89 53 58             	mov    %edx,0x58(%ebx)
    memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
80102981:	6a 34                	push   $0x34
80102983:	50                   	push   %eax
80102984:	8d 43 5c             	lea    0x5c(%ebx),%eax
80102987:	50                   	push   %eax
80102988:	e8 e3 28 00 00       	call   80105270 <memmove>
    brelse(bp);
8010298d:	89 34 24             	mov    %esi,(%esp)
80102990:	e8 1b 0a 00 00       	call   801033b0 <brelse>
    if(ip->type == 0)
80102995:	83 c4 10             	add    $0x10,%esp
80102998:	66 83 7b 50 00       	cmpw   $0x0,0x50(%ebx)
    ip->valid = 1;
8010299d:	c7 43 4c 01 00 00 00 	movl   $0x1,0x4c(%ebx)
    if(ip->type == 0)
801029a4:	0f 85 7b ff ff ff    	jne    80102925 <ilock+0x35>
      panic("ilock: no type");
801029aa:	83 ec 0c             	sub    $0xc,%esp
801029ad:	68 79 76 10 80       	push   $0x80107679
801029b2:	e8 09 f0 ff ff       	call   801019c0 <panic>
    panic("ilock");
801029b7:	83 ec 0c             	sub    $0xc,%esp
801029ba:	68 73 76 10 80       	push   $0x80107673
801029bf:	e8 fc ef ff ff       	call   801019c0 <panic>
801029c4:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801029cb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801029cf:	90                   	nop

801029d0 <iunlock>:
{
801029d0:	f3 0f 1e fb          	endbr32 
801029d4:	55                   	push   %ebp
801029d5:	89 e5                	mov    %esp,%ebp
801029d7:	56                   	push   %esi
801029d8:	53                   	push   %ebx
801029d9:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
801029dc:	85 db                	test   %ebx,%ebx
801029de:	74 28                	je     80102a08 <iunlock+0x38>
801029e0:	83 ec 0c             	sub    $0xc,%esp
801029e3:	8d 73 0c             	lea    0xc(%ebx),%esi
801029e6:	56                   	push   %esi
801029e7:	e8 c4 d8 ff ff       	call   801002b0 <holdingsleep>
801029ec:	83 c4 10             	add    $0x10,%esp
801029ef:	85 c0                	test   %eax,%eax
801029f1:	74 15                	je     80102a08 <iunlock+0x38>
801029f3:	8b 43 08             	mov    0x8(%ebx),%eax
801029f6:	85 c0                	test   %eax,%eax
801029f8:	7e 0e                	jle    80102a08 <iunlock+0x38>
  releasesleep(&ip->lock);
801029fa:	89 75 08             	mov    %esi,0x8(%ebp)
}
801029fd:	8d 65 f8             	lea    -0x8(%ebp),%esp
80102a00:	5b                   	pop    %ebx
80102a01:	5e                   	pop    %esi
80102a02:	5d                   	pop    %ebp
  releasesleep(&ip->lock);
80102a03:	e9 68 d8 ff ff       	jmp    80100270 <releasesleep>
    panic("iunlock");
80102a08:	83 ec 0c             	sub    $0xc,%esp
80102a0b:	68 88 76 10 80       	push   $0x80107688
80102a10:	e8 ab ef ff ff       	call   801019c0 <panic>
80102a15:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102a1c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80102a20 <iput>:
{
80102a20:	f3 0f 1e fb          	endbr32 
80102a24:	55                   	push   %ebp
80102a25:	89 e5                	mov    %esp,%ebp
80102a27:	57                   	push   %edi
80102a28:	56                   	push   %esi
80102a29:	53                   	push   %ebx
80102a2a:	83 ec 28             	sub    $0x28,%esp
80102a2d:	8b 5d 08             	mov    0x8(%ebp),%ebx
  acquiresleep(&ip->lock);
80102a30:	8d 7b 0c             	lea    0xc(%ebx),%edi
80102a33:	57                   	push   %edi
80102a34:	e8 d7 d7 ff ff       	call   80100210 <acquiresleep>
  if(ip->valid && ip->nlink == 0){
80102a39:	8b 53 4c             	mov    0x4c(%ebx),%edx
80102a3c:	83 c4 10             	add    $0x10,%esp
80102a3f:	85 d2                	test   %edx,%edx
80102a41:	74 07                	je     80102a4a <iput+0x2a>
80102a43:	66 83 7b 56 00       	cmpw   $0x0,0x56(%ebx)
80102a48:	74 36                	je     80102a80 <iput+0x60>
  releasesleep(&ip->lock);
80102a4a:	83 ec 0c             	sub    $0xc,%esp
80102a4d:	57                   	push   %edi
80102a4e:	e8 1d d8 ff ff       	call   80100270 <releasesleep>
  acquire(&icache.lock);
80102a53:	c7 04 24 60 ba 10 80 	movl   $0x8010ba60,(%esp)
80102a5a:	e8 31 da ff ff       	call   80100490 <acquire>
  ip->ref--;
80102a5f:	83 6b 08 01          	subl   $0x1,0x8(%ebx)
  release(&icache.lock);
80102a63:	83 c4 10             	add    $0x10,%esp
80102a66:	c7 45 08 60 ba 10 80 	movl   $0x8010ba60,0x8(%ebp)
}
80102a6d:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102a70:	5b                   	pop    %ebx
80102a71:	5e                   	pop    %esi
80102a72:	5f                   	pop    %edi
80102a73:	5d                   	pop    %ebp
  release(&icache.lock);
80102a74:	e9 d7 da ff ff       	jmp    80100550 <release>
80102a79:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    acquire(&icache.lock);
80102a80:	83 ec 0c             	sub    $0xc,%esp
80102a83:	68 60 ba 10 80       	push   $0x8010ba60
80102a88:	e8 03 da ff ff       	call   80100490 <acquire>
    int r = ip->ref;
80102a8d:	8b 73 08             	mov    0x8(%ebx),%esi
    release(&icache.lock);
80102a90:	c7 04 24 60 ba 10 80 	movl   $0x8010ba60,(%esp)
80102a97:	e8 b4 da ff ff       	call   80100550 <release>
    if(r == 1){
80102a9c:	83 c4 10             	add    $0x10,%esp
80102a9f:	83 fe 01             	cmp    $0x1,%esi
80102aa2:	75 a6                	jne    80102a4a <iput+0x2a>
80102aa4:	8d 8b 8c 00 00 00    	lea    0x8c(%ebx),%ecx
80102aaa:	89 7d e4             	mov    %edi,-0x1c(%ebp)
80102aad:	8d 73 5c             	lea    0x5c(%ebx),%esi
80102ab0:	89 cf                	mov    %ecx,%edi
80102ab2:	eb 0b                	jmp    80102abf <iput+0x9f>
80102ab4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
{
  int i, j;
  struct buf *bp;
  uint *a;

  for(i = 0; i < NDIRECT; i++){
80102ab8:	83 c6 04             	add    $0x4,%esi
80102abb:	39 fe                	cmp    %edi,%esi
80102abd:	74 19                	je     80102ad8 <iput+0xb8>
    if(ip->addrs[i]){
80102abf:	8b 16                	mov    (%esi),%edx
80102ac1:	85 d2                	test   %edx,%edx
80102ac3:	74 f3                	je     80102ab8 <iput+0x98>
      bfree(ip->dev, ip->addrs[i]);
80102ac5:	8b 03                	mov    (%ebx),%eax
80102ac7:	e8 74 f8 ff ff       	call   80102340 <bfree>
      ip->addrs[i] = 0;
80102acc:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
80102ad2:	eb e4                	jmp    80102ab8 <iput+0x98>
80102ad4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    }
  }

  if(ip->addrs[NDIRECT]){
80102ad8:	8b 83 8c 00 00 00    	mov    0x8c(%ebx),%eax
80102ade:	8b 7d e4             	mov    -0x1c(%ebp),%edi
80102ae1:	85 c0                	test   %eax,%eax
80102ae3:	75 33                	jne    80102b18 <iput+0xf8>
    bfree(ip->dev, ip->addrs[NDIRECT]);
    ip->addrs[NDIRECT] = 0;
  }

  ip->size = 0;
  iupdate(ip);
80102ae5:	83 ec 0c             	sub    $0xc,%esp
  ip->size = 0;
80102ae8:	c7 43 58 00 00 00 00 	movl   $0x0,0x58(%ebx)
  iupdate(ip);
80102aef:	53                   	push   %ebx
80102af0:	e8 3b fd ff ff       	call   80102830 <iupdate>
      ip->type = 0;
80102af5:	31 c0                	xor    %eax,%eax
80102af7:	66 89 43 50          	mov    %ax,0x50(%ebx)
      iupdate(ip);
80102afb:	89 1c 24             	mov    %ebx,(%esp)
80102afe:	e8 2d fd ff ff       	call   80102830 <iupdate>
      ip->valid = 0;
80102b03:	c7 43 4c 00 00 00 00 	movl   $0x0,0x4c(%ebx)
80102b0a:	83 c4 10             	add    $0x10,%esp
80102b0d:	e9 38 ff ff ff       	jmp    80102a4a <iput+0x2a>
80102b12:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    bp = bread(ip->dev, ip->addrs[NDIRECT]);
80102b18:	83 ec 08             	sub    $0x8,%esp
80102b1b:	50                   	push   %eax
80102b1c:	ff 33                	pushl  (%ebx)
80102b1e:	e8 6d 07 00 00       	call   80103290 <bread>
80102b23:	89 7d e0             	mov    %edi,-0x20(%ebp)
80102b26:	83 c4 10             	add    $0x10,%esp
80102b29:	8d 88 5c 02 00 00    	lea    0x25c(%eax),%ecx
80102b2f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    for(j = 0; j < NINDIRECT; j++){
80102b32:	8d 70 5c             	lea    0x5c(%eax),%esi
80102b35:	89 cf                	mov    %ecx,%edi
80102b37:	eb 0e                	jmp    80102b47 <iput+0x127>
80102b39:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102b40:	83 c6 04             	add    $0x4,%esi
80102b43:	39 f7                	cmp    %esi,%edi
80102b45:	74 19                	je     80102b60 <iput+0x140>
      if(a[j])
80102b47:	8b 16                	mov    (%esi),%edx
80102b49:	85 d2                	test   %edx,%edx
80102b4b:	74 f3                	je     80102b40 <iput+0x120>
        bfree(ip->dev, a[j]);
80102b4d:	8b 03                	mov    (%ebx),%eax
80102b4f:	e8 ec f7 ff ff       	call   80102340 <bfree>
80102b54:	eb ea                	jmp    80102b40 <iput+0x120>
80102b56:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102b5d:	8d 76 00             	lea    0x0(%esi),%esi
    brelse(bp);
80102b60:	83 ec 0c             	sub    $0xc,%esp
80102b63:	ff 75 e4             	pushl  -0x1c(%ebp)
80102b66:	8b 7d e0             	mov    -0x20(%ebp),%edi
80102b69:	e8 42 08 00 00       	call   801033b0 <brelse>
    bfree(ip->dev, ip->addrs[NDIRECT]);
80102b6e:	8b 93 8c 00 00 00    	mov    0x8c(%ebx),%edx
80102b74:	8b 03                	mov    (%ebx),%eax
80102b76:	e8 c5 f7 ff ff       	call   80102340 <bfree>
    ip->addrs[NDIRECT] = 0;
80102b7b:	83 c4 10             	add    $0x10,%esp
80102b7e:	c7 83 8c 00 00 00 00 	movl   $0x0,0x8c(%ebx)
80102b85:	00 00 00 
80102b88:	e9 58 ff ff ff       	jmp    80102ae5 <iput+0xc5>
80102b8d:	8d 76 00             	lea    0x0(%esi),%esi

80102b90 <iunlockput>:
{
80102b90:	f3 0f 1e fb          	endbr32 
80102b94:	55                   	push   %ebp
80102b95:	89 e5                	mov    %esp,%ebp
80102b97:	53                   	push   %ebx
80102b98:	83 ec 10             	sub    $0x10,%esp
80102b9b:	8b 5d 08             	mov    0x8(%ebp),%ebx
  iunlock(ip);
80102b9e:	53                   	push   %ebx
80102b9f:	e8 2c fe ff ff       	call   801029d0 <iunlock>
  iput(ip);
80102ba4:	89 5d 08             	mov    %ebx,0x8(%ebp)
80102ba7:	83 c4 10             	add    $0x10,%esp
}
80102baa:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80102bad:	c9                   	leave  
  iput(ip);
80102bae:	e9 6d fe ff ff       	jmp    80102a20 <iput>
80102bb3:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102bba:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80102bc0 <stati>:

// Copy stat information from inode.
// Caller must hold ip->lock.
void
stati(struct inode *ip, struct stat *st)
{
80102bc0:	f3 0f 1e fb          	endbr32 
80102bc4:	55                   	push   %ebp
80102bc5:	89 e5                	mov    %esp,%ebp
80102bc7:	8b 55 08             	mov    0x8(%ebp),%edx
80102bca:	8b 45 0c             	mov    0xc(%ebp),%eax
  st->dev = ip->dev;
80102bcd:	8b 0a                	mov    (%edx),%ecx
80102bcf:	89 48 04             	mov    %ecx,0x4(%eax)
  st->ino = ip->inum;
80102bd2:	8b 4a 04             	mov    0x4(%edx),%ecx
80102bd5:	89 48 08             	mov    %ecx,0x8(%eax)
  st->type = ip->type;
80102bd8:	0f b7 4a 50          	movzwl 0x50(%edx),%ecx
80102bdc:	66 89 08             	mov    %cx,(%eax)
  st->nlink = ip->nlink;
80102bdf:	0f b7 4a 56          	movzwl 0x56(%edx),%ecx
80102be3:	66 89 48 0c          	mov    %cx,0xc(%eax)
  st->size = ip->size;
80102be7:	8b 52 58             	mov    0x58(%edx),%edx
80102bea:	89 50 10             	mov    %edx,0x10(%eax)
}
80102bed:	5d                   	pop    %ebp
80102bee:	c3                   	ret    
80102bef:	90                   	nop

80102bf0 <readi>:
//PAGEBREAK!
// Read data from inode.
// Caller must hold ip->lock.
int
readi(struct inode *ip, char *dst, uint off, uint n)
{
80102bf0:	f3 0f 1e fb          	endbr32 
80102bf4:	55                   	push   %ebp
80102bf5:	89 e5                	mov    %esp,%ebp
80102bf7:	57                   	push   %edi
80102bf8:	56                   	push   %esi
80102bf9:	53                   	push   %ebx
80102bfa:	83 ec 1c             	sub    $0x1c,%esp
80102bfd:	8b 7d 0c             	mov    0xc(%ebp),%edi
80102c00:	8b 45 08             	mov    0x8(%ebp),%eax
80102c03:	8b 75 10             	mov    0x10(%ebp),%esi
80102c06:	89 7d e0             	mov    %edi,-0x20(%ebp)
80102c09:	8b 7d 14             	mov    0x14(%ebp),%edi
  uint tot, m;
  struct buf *bp;

  if(ip->type == T_DEV){
80102c0c:	66 83 78 50 03       	cmpw   $0x3,0x50(%eax)
{
80102c11:	89 45 d8             	mov    %eax,-0x28(%ebp)
80102c14:	89 7d e4             	mov    %edi,-0x1c(%ebp)
  if(ip->type == T_DEV){
80102c17:	0f 84 a3 00 00 00    	je     80102cc0 <readi+0xd0>
    if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
      return -1;
    return devsw[ip->major].read(ip, dst, n);
  }

  if(off > ip->size || off + n < off)
80102c1d:	8b 45 d8             	mov    -0x28(%ebp),%eax
80102c20:	8b 40 58             	mov    0x58(%eax),%eax
80102c23:	39 c6                	cmp    %eax,%esi
80102c25:	0f 87 b6 00 00 00    	ja     80102ce1 <readi+0xf1>
80102c2b:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
80102c2e:	31 c9                	xor    %ecx,%ecx
80102c30:	89 da                	mov    %ebx,%edx
80102c32:	01 f2                	add    %esi,%edx
80102c34:	0f 92 c1             	setb   %cl
80102c37:	89 cf                	mov    %ecx,%edi
80102c39:	0f 82 a2 00 00 00    	jb     80102ce1 <readi+0xf1>
    return -1;
  if(off + n > ip->size)
    n = ip->size - off;
80102c3f:	89 c1                	mov    %eax,%ecx
80102c41:	29 f1                	sub    %esi,%ecx
80102c43:	39 d0                	cmp    %edx,%eax
80102c45:	0f 43 cb             	cmovae %ebx,%ecx
80102c48:	89 4d e4             	mov    %ecx,-0x1c(%ebp)

  for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80102c4b:	85 c9                	test   %ecx,%ecx
80102c4d:	74 63                	je     80102cb2 <readi+0xc2>
80102c4f:	90                   	nop
    bp = bread(ip->dev, bmap(ip, off/BSIZE));
80102c50:	8b 5d d8             	mov    -0x28(%ebp),%ebx
80102c53:	89 f2                	mov    %esi,%edx
80102c55:	c1 ea 09             	shr    $0x9,%edx
80102c58:	89 d8                	mov    %ebx,%eax
80102c5a:	e8 61 f9 ff ff       	call   801025c0 <bmap>
80102c5f:	83 ec 08             	sub    $0x8,%esp
80102c62:	50                   	push   %eax
80102c63:	ff 33                	pushl  (%ebx)
80102c65:	e8 26 06 00 00       	call   80103290 <bread>
    m = min(n - tot, BSIZE - off%BSIZE);
80102c6a:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
80102c6d:	b9 00 02 00 00       	mov    $0x200,%ecx
80102c72:	83 c4 0c             	add    $0xc,%esp
    bp = bread(ip->dev, bmap(ip, off/BSIZE));
80102c75:	89 c2                	mov    %eax,%edx
    m = min(n - tot, BSIZE - off%BSIZE);
80102c77:	89 f0                	mov    %esi,%eax
80102c79:	25 ff 01 00 00       	and    $0x1ff,%eax
80102c7e:	29 fb                	sub    %edi,%ebx
    memmove(dst, bp->data + off%BSIZE, m);
80102c80:	89 55 dc             	mov    %edx,-0x24(%ebp)
    m = min(n - tot, BSIZE - off%BSIZE);
80102c83:	29 c1                	sub    %eax,%ecx
    memmove(dst, bp->data + off%BSIZE, m);
80102c85:	8d 44 02 5c          	lea    0x5c(%edx,%eax,1),%eax
    m = min(n - tot, BSIZE - off%BSIZE);
80102c89:	39 d9                	cmp    %ebx,%ecx
80102c8b:	0f 46 d9             	cmovbe %ecx,%ebx
    memmove(dst, bp->data + off%BSIZE, m);
80102c8e:	53                   	push   %ebx
  for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80102c8f:	01 df                	add    %ebx,%edi
80102c91:	01 de                	add    %ebx,%esi
    memmove(dst, bp->data + off%BSIZE, m);
80102c93:	50                   	push   %eax
80102c94:	ff 75 e0             	pushl  -0x20(%ebp)
80102c97:	e8 d4 25 00 00       	call   80105270 <memmove>
    brelse(bp);
80102c9c:	8b 55 dc             	mov    -0x24(%ebp),%edx
80102c9f:	89 14 24             	mov    %edx,(%esp)
80102ca2:	e8 09 07 00 00       	call   801033b0 <brelse>
  for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80102ca7:	01 5d e0             	add    %ebx,-0x20(%ebp)
80102caa:	83 c4 10             	add    $0x10,%esp
80102cad:	39 7d e4             	cmp    %edi,-0x1c(%ebp)
80102cb0:	77 9e                	ja     80102c50 <readi+0x60>
  }
  return n;
80102cb2:	8b 45 e4             	mov    -0x1c(%ebp),%eax
}
80102cb5:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102cb8:	5b                   	pop    %ebx
80102cb9:	5e                   	pop    %esi
80102cba:	5f                   	pop    %edi
80102cbb:	5d                   	pop    %ebp
80102cbc:	c3                   	ret    
80102cbd:	8d 76 00             	lea    0x0(%esi),%esi
    if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
80102cc0:	0f bf 40 52          	movswl 0x52(%eax),%eax
80102cc4:	66 83 f8 09          	cmp    $0x9,%ax
80102cc8:	77 17                	ja     80102ce1 <readi+0xf1>
80102cca:	8b 04 c5 40 b9 10 80 	mov    -0x7fef46c0(,%eax,8),%eax
80102cd1:	85 c0                	test   %eax,%eax
80102cd3:	74 0c                	je     80102ce1 <readi+0xf1>
    return devsw[ip->major].read(ip, dst, n);
80102cd5:	89 7d 10             	mov    %edi,0x10(%ebp)
}
80102cd8:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102cdb:	5b                   	pop    %ebx
80102cdc:	5e                   	pop    %esi
80102cdd:	5f                   	pop    %edi
80102cde:	5d                   	pop    %ebp
    return devsw[ip->major].read(ip, dst, n);
80102cdf:	ff e0                	jmp    *%eax
      return -1;
80102ce1:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80102ce6:	eb cd                	jmp    80102cb5 <readi+0xc5>
80102ce8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102cef:	90                   	nop

80102cf0 <writei>:
// PAGEBREAK!
// Write data to inode.
// Caller must hold ip->lock.
int
writei(struct inode *ip, char *src, uint off, uint n)
{
80102cf0:	f3 0f 1e fb          	endbr32 
80102cf4:	55                   	push   %ebp
80102cf5:	89 e5                	mov    %esp,%ebp
80102cf7:	57                   	push   %edi
80102cf8:	56                   	push   %esi
80102cf9:	53                   	push   %ebx
80102cfa:	83 ec 1c             	sub    $0x1c,%esp
80102cfd:	8b 45 08             	mov    0x8(%ebp),%eax
80102d00:	8b 75 0c             	mov    0xc(%ebp),%esi
80102d03:	8b 7d 14             	mov    0x14(%ebp),%edi
  uint tot, m;
  struct buf *bp;

  if(ip->type == T_DEV){
80102d06:	66 83 78 50 03       	cmpw   $0x3,0x50(%eax)
{
80102d0b:	89 75 dc             	mov    %esi,-0x24(%ebp)
80102d0e:	89 45 d8             	mov    %eax,-0x28(%ebp)
80102d11:	8b 75 10             	mov    0x10(%ebp),%esi
80102d14:	89 7d e0             	mov    %edi,-0x20(%ebp)
  if(ip->type == T_DEV){
80102d17:	0f 84 b3 00 00 00    	je     80102dd0 <writei+0xe0>
    if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
      return -1;
    return devsw[ip->major].write(ip, src, n);
  }

  if(off > ip->size || off + n < off)
80102d1d:	8b 45 d8             	mov    -0x28(%ebp),%eax
80102d20:	39 70 58             	cmp    %esi,0x58(%eax)
80102d23:	0f 82 e3 00 00 00    	jb     80102e0c <writei+0x11c>
    return -1;
  if(off + n > MAXFILE*BSIZE)
80102d29:	8b 7d e0             	mov    -0x20(%ebp),%edi
80102d2c:	89 f8                	mov    %edi,%eax
80102d2e:	01 f0                	add    %esi,%eax
80102d30:	0f 82 d6 00 00 00    	jb     80102e0c <writei+0x11c>
80102d36:	3d 00 18 01 00       	cmp    $0x11800,%eax
80102d3b:	0f 87 cb 00 00 00    	ja     80102e0c <writei+0x11c>
    return -1;

  for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80102d41:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
80102d48:	85 ff                	test   %edi,%edi
80102d4a:	74 75                	je     80102dc1 <writei+0xd1>
80102d4c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    bp = bread(ip->dev, bmap(ip, off/BSIZE));
80102d50:	8b 7d d8             	mov    -0x28(%ebp),%edi
80102d53:	89 f2                	mov    %esi,%edx
80102d55:	c1 ea 09             	shr    $0x9,%edx
80102d58:	89 f8                	mov    %edi,%eax
80102d5a:	e8 61 f8 ff ff       	call   801025c0 <bmap>
80102d5f:	83 ec 08             	sub    $0x8,%esp
80102d62:	50                   	push   %eax
80102d63:	ff 37                	pushl  (%edi)
80102d65:	e8 26 05 00 00       	call   80103290 <bread>
    m = min(n - tot, BSIZE - off%BSIZE);
80102d6a:	b9 00 02 00 00       	mov    $0x200,%ecx
80102d6f:	8b 5d e0             	mov    -0x20(%ebp),%ebx
80102d72:	2b 5d e4             	sub    -0x1c(%ebp),%ebx
    bp = bread(ip->dev, bmap(ip, off/BSIZE));
80102d75:	89 c7                	mov    %eax,%edi
    m = min(n - tot, BSIZE - off%BSIZE);
80102d77:	89 f0                	mov    %esi,%eax
80102d79:	83 c4 0c             	add    $0xc,%esp
80102d7c:	25 ff 01 00 00       	and    $0x1ff,%eax
80102d81:	29 c1                	sub    %eax,%ecx
    memmove(bp->data + off%BSIZE, src, m);
80102d83:	8d 44 07 5c          	lea    0x5c(%edi,%eax,1),%eax
    m = min(n - tot, BSIZE - off%BSIZE);
80102d87:	39 d9                	cmp    %ebx,%ecx
80102d89:	0f 46 d9             	cmovbe %ecx,%ebx
    memmove(bp->data + off%BSIZE, src, m);
80102d8c:	53                   	push   %ebx
  for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80102d8d:	01 de                	add    %ebx,%esi
    memmove(bp->data + off%BSIZE, src, m);
80102d8f:	ff 75 dc             	pushl  -0x24(%ebp)
80102d92:	50                   	push   %eax
80102d93:	e8 d8 24 00 00       	call   80105270 <memmove>
    log_write(bp);
80102d98:	89 3c 24             	mov    %edi,(%esp)
80102d9b:	e8 e0 e2 ff ff       	call   80101080 <log_write>
    brelse(bp);
80102da0:	89 3c 24             	mov    %edi,(%esp)
80102da3:	e8 08 06 00 00       	call   801033b0 <brelse>
  for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80102da8:	01 5d e4             	add    %ebx,-0x1c(%ebp)
80102dab:	83 c4 10             	add    $0x10,%esp
80102dae:	8b 45 e4             	mov    -0x1c(%ebp),%eax
80102db1:	01 5d dc             	add    %ebx,-0x24(%ebp)
80102db4:	39 45 e0             	cmp    %eax,-0x20(%ebp)
80102db7:	77 97                	ja     80102d50 <writei+0x60>
  }

  if(n > 0 && off > ip->size){
80102db9:	8b 45 d8             	mov    -0x28(%ebp),%eax
80102dbc:	3b 70 58             	cmp    0x58(%eax),%esi
80102dbf:	77 37                	ja     80102df8 <writei+0x108>
    ip->size = off;
    iupdate(ip);
  }
  return n;
80102dc1:	8b 45 e0             	mov    -0x20(%ebp),%eax
}
80102dc4:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102dc7:	5b                   	pop    %ebx
80102dc8:	5e                   	pop    %esi
80102dc9:	5f                   	pop    %edi
80102dca:	5d                   	pop    %ebp
80102dcb:	c3                   	ret    
80102dcc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
80102dd0:	0f bf 40 52          	movswl 0x52(%eax),%eax
80102dd4:	66 83 f8 09          	cmp    $0x9,%ax
80102dd8:	77 32                	ja     80102e0c <writei+0x11c>
80102dda:	8b 04 c5 44 b9 10 80 	mov    -0x7fef46bc(,%eax,8),%eax
80102de1:	85 c0                	test   %eax,%eax
80102de3:	74 27                	je     80102e0c <writei+0x11c>
    return devsw[ip->major].write(ip, src, n);
80102de5:	89 7d 10             	mov    %edi,0x10(%ebp)
}
80102de8:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102deb:	5b                   	pop    %ebx
80102dec:	5e                   	pop    %esi
80102ded:	5f                   	pop    %edi
80102dee:	5d                   	pop    %ebp
    return devsw[ip->major].write(ip, src, n);
80102def:	ff e0                	jmp    *%eax
80102df1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    ip->size = off;
80102df8:	8b 45 d8             	mov    -0x28(%ebp),%eax
    iupdate(ip);
80102dfb:	83 ec 0c             	sub    $0xc,%esp
    ip->size = off;
80102dfe:	89 70 58             	mov    %esi,0x58(%eax)
    iupdate(ip);
80102e01:	50                   	push   %eax
80102e02:	e8 29 fa ff ff       	call   80102830 <iupdate>
80102e07:	83 c4 10             	add    $0x10,%esp
80102e0a:	eb b5                	jmp    80102dc1 <writei+0xd1>
      return -1;
80102e0c:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80102e11:	eb b1                	jmp    80102dc4 <writei+0xd4>
80102e13:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102e1a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80102e20 <namecmp>:
//PAGEBREAK!
// Directories

int
namecmp(const char *s, const char *t)
{
80102e20:	f3 0f 1e fb          	endbr32 
80102e24:	55                   	push   %ebp
80102e25:	89 e5                	mov    %esp,%ebp
80102e27:	83 ec 0c             	sub    $0xc,%esp
  return strncmp(s, t, DIRSIZ);
80102e2a:	6a 0e                	push   $0xe
80102e2c:	ff 75 0c             	pushl  0xc(%ebp)
80102e2f:	ff 75 08             	pushl  0x8(%ebp)
80102e32:	e8 a9 24 00 00       	call   801052e0 <strncmp>
}
80102e37:	c9                   	leave  
80102e38:	c3                   	ret    
80102e39:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80102e40 <dirlookup>:

// Look for a directory entry in a directory.
// If found, set *poff to byte offset of entry.
struct inode*
dirlookup(struct inode *dp, char *name, uint *poff)
{
80102e40:	f3 0f 1e fb          	endbr32 
80102e44:	55                   	push   %ebp
80102e45:	89 e5                	mov    %esp,%ebp
80102e47:	57                   	push   %edi
80102e48:	56                   	push   %esi
80102e49:	53                   	push   %ebx
80102e4a:	83 ec 1c             	sub    $0x1c,%esp
80102e4d:	8b 5d 08             	mov    0x8(%ebp),%ebx
  uint off, inum;
  struct dirent de;

  if(dp->type != T_DIR)
80102e50:	66 83 7b 50 01       	cmpw   $0x1,0x50(%ebx)
80102e55:	0f 85 89 00 00 00    	jne    80102ee4 <dirlookup+0xa4>
    panic("dirlookup not DIR");

  for(off = 0; off < dp->size; off += sizeof(de)){
80102e5b:	8b 53 58             	mov    0x58(%ebx),%edx
80102e5e:	31 ff                	xor    %edi,%edi
80102e60:	8d 75 d8             	lea    -0x28(%ebp),%esi
80102e63:	85 d2                	test   %edx,%edx
80102e65:	74 42                	je     80102ea9 <dirlookup+0x69>
80102e67:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102e6e:	66 90                	xchg   %ax,%ax
    if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80102e70:	6a 10                	push   $0x10
80102e72:	57                   	push   %edi
80102e73:	56                   	push   %esi
80102e74:	53                   	push   %ebx
80102e75:	e8 76 fd ff ff       	call   80102bf0 <readi>
80102e7a:	83 c4 10             	add    $0x10,%esp
80102e7d:	83 f8 10             	cmp    $0x10,%eax
80102e80:	75 55                	jne    80102ed7 <dirlookup+0x97>
      panic("dirlookup read");
    if(de.inum == 0)
80102e82:	66 83 7d d8 00       	cmpw   $0x0,-0x28(%ebp)
80102e87:	74 18                	je     80102ea1 <dirlookup+0x61>
  return strncmp(s, t, DIRSIZ);
80102e89:	83 ec 04             	sub    $0x4,%esp
80102e8c:	8d 45 da             	lea    -0x26(%ebp),%eax
80102e8f:	6a 0e                	push   $0xe
80102e91:	50                   	push   %eax
80102e92:	ff 75 0c             	pushl  0xc(%ebp)
80102e95:	e8 46 24 00 00       	call   801052e0 <strncmp>
      continue;
    if(namecmp(name, de.name) == 0){
80102e9a:	83 c4 10             	add    $0x10,%esp
80102e9d:	85 c0                	test   %eax,%eax
80102e9f:	74 17                	je     80102eb8 <dirlookup+0x78>
  for(off = 0; off < dp->size; off += sizeof(de)){
80102ea1:	83 c7 10             	add    $0x10,%edi
80102ea4:	3b 7b 58             	cmp    0x58(%ebx),%edi
80102ea7:	72 c7                	jb     80102e70 <dirlookup+0x30>
      return iget(dp->dev, inum);
    }
  }

  return 0;
}
80102ea9:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return 0;
80102eac:	31 c0                	xor    %eax,%eax
}
80102eae:	5b                   	pop    %ebx
80102eaf:	5e                   	pop    %esi
80102eb0:	5f                   	pop    %edi
80102eb1:	5d                   	pop    %ebp
80102eb2:	c3                   	ret    
80102eb3:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80102eb7:	90                   	nop
      if(poff)
80102eb8:	8b 45 10             	mov    0x10(%ebp),%eax
80102ebb:	85 c0                	test   %eax,%eax
80102ebd:	74 05                	je     80102ec4 <dirlookup+0x84>
        *poff = off;
80102ebf:	8b 45 10             	mov    0x10(%ebp),%eax
80102ec2:	89 38                	mov    %edi,(%eax)
      inum = de.inum;
80102ec4:	0f b7 55 d8          	movzwl -0x28(%ebp),%edx
      return iget(dp->dev, inum);
80102ec8:	8b 03                	mov    (%ebx),%eax
80102eca:	e8 01 f6 ff ff       	call   801024d0 <iget>
}
80102ecf:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102ed2:	5b                   	pop    %ebx
80102ed3:	5e                   	pop    %esi
80102ed4:	5f                   	pop    %edi
80102ed5:	5d                   	pop    %ebp
80102ed6:	c3                   	ret    
      panic("dirlookup read");
80102ed7:	83 ec 0c             	sub    $0xc,%esp
80102eda:	68 a2 76 10 80       	push   $0x801076a2
80102edf:	e8 dc ea ff ff       	call   801019c0 <panic>
    panic("dirlookup not DIR");
80102ee4:	83 ec 0c             	sub    $0xc,%esp
80102ee7:	68 90 76 10 80       	push   $0x80107690
80102eec:	e8 cf ea ff ff       	call   801019c0 <panic>
80102ef1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102ef8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102eff:	90                   	nop

80102f00 <namex>:
// If parent != 0, return the inode for the parent and copy the final
// path element into name, which must have room for DIRSIZ bytes.
// Must be called inside a transaction since it calls iput().
static struct inode*
namex(char *path, int nameiparent, char *name)
{
80102f00:	55                   	push   %ebp
80102f01:	89 e5                	mov    %esp,%ebp
80102f03:	57                   	push   %edi
80102f04:	56                   	push   %esi
80102f05:	53                   	push   %ebx
80102f06:	89 c3                	mov    %eax,%ebx
80102f08:	83 ec 1c             	sub    $0x1c,%esp
  struct inode *ip, *next;

  if(*path == '/')
80102f0b:	80 38 2f             	cmpb   $0x2f,(%eax)
{
80102f0e:	89 55 e0             	mov    %edx,-0x20(%ebp)
80102f11:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
  if(*path == '/')
80102f14:	0f 84 86 01 00 00    	je     801030a0 <namex+0x1a0>
    ip = iget(ROOTDEV, ROOTINO);
  else
    ip = idup(myproc()->cwd);
80102f1a:	e8 21 0a 00 00       	call   80103940 <myproc>
  acquire(&icache.lock);
80102f1f:	83 ec 0c             	sub    $0xc,%esp
80102f22:	89 df                	mov    %ebx,%edi
    ip = idup(myproc()->cwd);
80102f24:	8b 70 68             	mov    0x68(%eax),%esi
  acquire(&icache.lock);
80102f27:	68 60 ba 10 80       	push   $0x8010ba60
80102f2c:	e8 5f d5 ff ff       	call   80100490 <acquire>
  ip->ref++;
80102f31:	83 46 08 01          	addl   $0x1,0x8(%esi)
  release(&icache.lock);
80102f35:	c7 04 24 60 ba 10 80 	movl   $0x8010ba60,(%esp)
80102f3c:	e8 0f d6 ff ff       	call   80100550 <release>
80102f41:	83 c4 10             	add    $0x10,%esp
80102f44:	eb 0d                	jmp    80102f53 <namex+0x53>
80102f46:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102f4d:	8d 76 00             	lea    0x0(%esi),%esi
    path++;
80102f50:	83 c7 01             	add    $0x1,%edi
  while(*path == '/')
80102f53:	0f b6 07             	movzbl (%edi),%eax
80102f56:	3c 2f                	cmp    $0x2f,%al
80102f58:	74 f6                	je     80102f50 <namex+0x50>
  if(*path == 0)
80102f5a:	84 c0                	test   %al,%al
80102f5c:	0f 84 ee 00 00 00    	je     80103050 <namex+0x150>
  while(*path != '/' && *path != 0)
80102f62:	0f b6 07             	movzbl (%edi),%eax
80102f65:	84 c0                	test   %al,%al
80102f67:	0f 84 fb 00 00 00    	je     80103068 <namex+0x168>
80102f6d:	89 fb                	mov    %edi,%ebx
80102f6f:	3c 2f                	cmp    $0x2f,%al
80102f71:	0f 84 f1 00 00 00    	je     80103068 <namex+0x168>
80102f77:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102f7e:	66 90                	xchg   %ax,%ax
80102f80:	0f b6 43 01          	movzbl 0x1(%ebx),%eax
    path++;
80102f84:	83 c3 01             	add    $0x1,%ebx
  while(*path != '/' && *path != 0)
80102f87:	3c 2f                	cmp    $0x2f,%al
80102f89:	74 04                	je     80102f8f <namex+0x8f>
80102f8b:	84 c0                	test   %al,%al
80102f8d:	75 f1                	jne    80102f80 <namex+0x80>
  len = path - s;
80102f8f:	89 d8                	mov    %ebx,%eax
80102f91:	29 f8                	sub    %edi,%eax
  if(len >= DIRSIZ)
80102f93:	83 f8 0d             	cmp    $0xd,%eax
80102f96:	0f 8e 84 00 00 00    	jle    80103020 <namex+0x120>
    memmove(name, s, DIRSIZ);
80102f9c:	83 ec 04             	sub    $0x4,%esp
80102f9f:	6a 0e                	push   $0xe
80102fa1:	57                   	push   %edi
    path++;
80102fa2:	89 df                	mov    %ebx,%edi
    memmove(name, s, DIRSIZ);
80102fa4:	ff 75 e4             	pushl  -0x1c(%ebp)
80102fa7:	e8 c4 22 00 00       	call   80105270 <memmove>
80102fac:	83 c4 10             	add    $0x10,%esp
  while(*path == '/')
80102faf:	80 3b 2f             	cmpb   $0x2f,(%ebx)
80102fb2:	75 0c                	jne    80102fc0 <namex+0xc0>
80102fb4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    path++;
80102fb8:	83 c7 01             	add    $0x1,%edi
  while(*path == '/')
80102fbb:	80 3f 2f             	cmpb   $0x2f,(%edi)
80102fbe:	74 f8                	je     80102fb8 <namex+0xb8>

  while((path = skipelem(path, name)) != 0){
    ilock(ip);
80102fc0:	83 ec 0c             	sub    $0xc,%esp
80102fc3:	56                   	push   %esi
80102fc4:	e8 27 f9 ff ff       	call   801028f0 <ilock>
    if(ip->type != T_DIR){
80102fc9:	83 c4 10             	add    $0x10,%esp
80102fcc:	66 83 7e 50 01       	cmpw   $0x1,0x50(%esi)
80102fd1:	0f 85 a1 00 00 00    	jne    80103078 <namex+0x178>
      iunlockput(ip);
      return 0;
    }
    if(nameiparent && *path == '\0'){
80102fd7:	8b 55 e0             	mov    -0x20(%ebp),%edx
80102fda:	85 d2                	test   %edx,%edx
80102fdc:	74 09                	je     80102fe7 <namex+0xe7>
80102fde:	80 3f 00             	cmpb   $0x0,(%edi)
80102fe1:	0f 84 d9 00 00 00    	je     801030c0 <namex+0x1c0>
      // Stop one level early.
      iunlock(ip);
      return ip;
    }
    if((next = dirlookup(ip, name, 0)) == 0){
80102fe7:	83 ec 04             	sub    $0x4,%esp
80102fea:	6a 00                	push   $0x0
80102fec:	ff 75 e4             	pushl  -0x1c(%ebp)
80102fef:	56                   	push   %esi
80102ff0:	e8 4b fe ff ff       	call   80102e40 <dirlookup>
80102ff5:	83 c4 10             	add    $0x10,%esp
80102ff8:	89 c3                	mov    %eax,%ebx
80102ffa:	85 c0                	test   %eax,%eax
80102ffc:	74 7a                	je     80103078 <namex+0x178>
  iunlock(ip);
80102ffe:	83 ec 0c             	sub    $0xc,%esp
80103001:	56                   	push   %esi
80103002:	e8 c9 f9 ff ff       	call   801029d0 <iunlock>
  iput(ip);
80103007:	89 34 24             	mov    %esi,(%esp)
8010300a:	89 de                	mov    %ebx,%esi
8010300c:	e8 0f fa ff ff       	call   80102a20 <iput>
80103011:	83 c4 10             	add    $0x10,%esp
80103014:	e9 3a ff ff ff       	jmp    80102f53 <namex+0x53>
80103019:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103020:	8b 55 e4             	mov    -0x1c(%ebp),%edx
80103023:	8d 0c 02             	lea    (%edx,%eax,1),%ecx
80103026:	89 4d dc             	mov    %ecx,-0x24(%ebp)
    memmove(name, s, len);
80103029:	83 ec 04             	sub    $0x4,%esp
8010302c:	50                   	push   %eax
8010302d:	57                   	push   %edi
    name[len] = 0;
8010302e:	89 df                	mov    %ebx,%edi
    memmove(name, s, len);
80103030:	ff 75 e4             	pushl  -0x1c(%ebp)
80103033:	e8 38 22 00 00       	call   80105270 <memmove>
    name[len] = 0;
80103038:	8b 45 dc             	mov    -0x24(%ebp),%eax
8010303b:	83 c4 10             	add    $0x10,%esp
8010303e:	c6 00 00             	movb   $0x0,(%eax)
80103041:	e9 69 ff ff ff       	jmp    80102faf <namex+0xaf>
80103046:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010304d:	8d 76 00             	lea    0x0(%esi),%esi
      return 0;
    }
    iunlockput(ip);
    ip = next;
  }
  if(nameiparent){
80103050:	8b 45 e0             	mov    -0x20(%ebp),%eax
80103053:	85 c0                	test   %eax,%eax
80103055:	0f 85 85 00 00 00    	jne    801030e0 <namex+0x1e0>
    iput(ip);
    return 0;
  }
  return ip;
}
8010305b:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010305e:	89 f0                	mov    %esi,%eax
80103060:	5b                   	pop    %ebx
80103061:	5e                   	pop    %esi
80103062:	5f                   	pop    %edi
80103063:	5d                   	pop    %ebp
80103064:	c3                   	ret    
80103065:	8d 76 00             	lea    0x0(%esi),%esi
  while(*path != '/' && *path != 0)
80103068:	8b 45 e4             	mov    -0x1c(%ebp),%eax
8010306b:	89 fb                	mov    %edi,%ebx
8010306d:	89 45 dc             	mov    %eax,-0x24(%ebp)
80103070:	31 c0                	xor    %eax,%eax
80103072:	eb b5                	jmp    80103029 <namex+0x129>
80103074:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  iunlock(ip);
80103078:	83 ec 0c             	sub    $0xc,%esp
8010307b:	56                   	push   %esi
8010307c:	e8 4f f9 ff ff       	call   801029d0 <iunlock>
  iput(ip);
80103081:	89 34 24             	mov    %esi,(%esp)
      return 0;
80103084:	31 f6                	xor    %esi,%esi
  iput(ip);
80103086:	e8 95 f9 ff ff       	call   80102a20 <iput>
      return 0;
8010308b:	83 c4 10             	add    $0x10,%esp
}
8010308e:	8d 65 f4             	lea    -0xc(%ebp),%esp
80103091:	89 f0                	mov    %esi,%eax
80103093:	5b                   	pop    %ebx
80103094:	5e                   	pop    %esi
80103095:	5f                   	pop    %edi
80103096:	5d                   	pop    %ebp
80103097:	c3                   	ret    
80103098:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010309f:	90                   	nop
    ip = iget(ROOTDEV, ROOTINO);
801030a0:	ba 01 00 00 00       	mov    $0x1,%edx
801030a5:	b8 01 00 00 00       	mov    $0x1,%eax
801030aa:	89 df                	mov    %ebx,%edi
801030ac:	e8 1f f4 ff ff       	call   801024d0 <iget>
801030b1:	89 c6                	mov    %eax,%esi
801030b3:	e9 9b fe ff ff       	jmp    80102f53 <namex+0x53>
801030b8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801030bf:	90                   	nop
      iunlock(ip);
801030c0:	83 ec 0c             	sub    $0xc,%esp
801030c3:	56                   	push   %esi
801030c4:	e8 07 f9 ff ff       	call   801029d0 <iunlock>
      return ip;
801030c9:	83 c4 10             	add    $0x10,%esp
}
801030cc:	8d 65 f4             	lea    -0xc(%ebp),%esp
801030cf:	89 f0                	mov    %esi,%eax
801030d1:	5b                   	pop    %ebx
801030d2:	5e                   	pop    %esi
801030d3:	5f                   	pop    %edi
801030d4:	5d                   	pop    %ebp
801030d5:	c3                   	ret    
801030d6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801030dd:	8d 76 00             	lea    0x0(%esi),%esi
    iput(ip);
801030e0:	83 ec 0c             	sub    $0xc,%esp
801030e3:	56                   	push   %esi
    return 0;
801030e4:	31 f6                	xor    %esi,%esi
    iput(ip);
801030e6:	e8 35 f9 ff ff       	call   80102a20 <iput>
    return 0;
801030eb:	83 c4 10             	add    $0x10,%esp
801030ee:	e9 68 ff ff ff       	jmp    8010305b <namex+0x15b>
801030f3:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801030fa:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80103100 <dirlink>:
{
80103100:	f3 0f 1e fb          	endbr32 
80103104:	55                   	push   %ebp
80103105:	89 e5                	mov    %esp,%ebp
80103107:	57                   	push   %edi
80103108:	56                   	push   %esi
80103109:	53                   	push   %ebx
8010310a:	83 ec 20             	sub    $0x20,%esp
8010310d:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if((ip = dirlookup(dp, name, 0)) != 0){
80103110:	6a 00                	push   $0x0
80103112:	ff 75 0c             	pushl  0xc(%ebp)
80103115:	53                   	push   %ebx
80103116:	e8 25 fd ff ff       	call   80102e40 <dirlookup>
8010311b:	83 c4 10             	add    $0x10,%esp
8010311e:	85 c0                	test   %eax,%eax
80103120:	75 6b                	jne    8010318d <dirlink+0x8d>
  for(off = 0; off < dp->size; off += sizeof(de)){
80103122:	8b 7b 58             	mov    0x58(%ebx),%edi
80103125:	8d 75 d8             	lea    -0x28(%ebp),%esi
80103128:	85 ff                	test   %edi,%edi
8010312a:	74 2d                	je     80103159 <dirlink+0x59>
8010312c:	31 ff                	xor    %edi,%edi
8010312e:	8d 75 d8             	lea    -0x28(%ebp),%esi
80103131:	eb 0d                	jmp    80103140 <dirlink+0x40>
80103133:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80103137:	90                   	nop
80103138:	83 c7 10             	add    $0x10,%edi
8010313b:	3b 7b 58             	cmp    0x58(%ebx),%edi
8010313e:	73 19                	jae    80103159 <dirlink+0x59>
    if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80103140:	6a 10                	push   $0x10
80103142:	57                   	push   %edi
80103143:	56                   	push   %esi
80103144:	53                   	push   %ebx
80103145:	e8 a6 fa ff ff       	call   80102bf0 <readi>
8010314a:	83 c4 10             	add    $0x10,%esp
8010314d:	83 f8 10             	cmp    $0x10,%eax
80103150:	75 4e                	jne    801031a0 <dirlink+0xa0>
    if(de.inum == 0)
80103152:	66 83 7d d8 00       	cmpw   $0x0,-0x28(%ebp)
80103157:	75 df                	jne    80103138 <dirlink+0x38>
  strncpy(de.name, name, DIRSIZ);
80103159:	83 ec 04             	sub    $0x4,%esp
8010315c:	8d 45 da             	lea    -0x26(%ebp),%eax
8010315f:	6a 0e                	push   $0xe
80103161:	ff 75 0c             	pushl  0xc(%ebp)
80103164:	50                   	push   %eax
80103165:	e8 c6 21 00 00       	call   80105330 <strncpy>
  if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
8010316a:	6a 10                	push   $0x10
  de.inum = inum;
8010316c:	8b 45 10             	mov    0x10(%ebp),%eax
  if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
8010316f:	57                   	push   %edi
80103170:	56                   	push   %esi
80103171:	53                   	push   %ebx
  de.inum = inum;
80103172:	66 89 45 d8          	mov    %ax,-0x28(%ebp)
  if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80103176:	e8 75 fb ff ff       	call   80102cf0 <writei>
8010317b:	83 c4 20             	add    $0x20,%esp
8010317e:	83 f8 10             	cmp    $0x10,%eax
80103181:	75 2a                	jne    801031ad <dirlink+0xad>
  return 0;
80103183:	31 c0                	xor    %eax,%eax
}
80103185:	8d 65 f4             	lea    -0xc(%ebp),%esp
80103188:	5b                   	pop    %ebx
80103189:	5e                   	pop    %esi
8010318a:	5f                   	pop    %edi
8010318b:	5d                   	pop    %ebp
8010318c:	c3                   	ret    
    iput(ip);
8010318d:	83 ec 0c             	sub    $0xc,%esp
80103190:	50                   	push   %eax
80103191:	e8 8a f8 ff ff       	call   80102a20 <iput>
    return -1;
80103196:	83 c4 10             	add    $0x10,%esp
80103199:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
8010319e:	eb e5                	jmp    80103185 <dirlink+0x85>
      panic("dirlink read");
801031a0:	83 ec 0c             	sub    $0xc,%esp
801031a3:	68 b1 76 10 80       	push   $0x801076b1
801031a8:	e8 13 e8 ff ff       	call   801019c0 <panic>
    panic("dirlink");
801031ad:	83 ec 0c             	sub    $0xc,%esp
801031b0:	68 ce 7a 10 80       	push   $0x80107ace
801031b5:	e8 06 e8 ff ff       	call   801019c0 <panic>
801031ba:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801031c0 <namei>:

struct inode*
namei(char *path)
{
801031c0:	f3 0f 1e fb          	endbr32 
801031c4:	55                   	push   %ebp
  char name[DIRSIZ];
  return namex(path, 0, name);
801031c5:	31 d2                	xor    %edx,%edx
{
801031c7:	89 e5                	mov    %esp,%ebp
801031c9:	83 ec 18             	sub    $0x18,%esp
  return namex(path, 0, name);
801031cc:	8b 45 08             	mov    0x8(%ebp),%eax
801031cf:	8d 4d ea             	lea    -0x16(%ebp),%ecx
801031d2:	e8 29 fd ff ff       	call   80102f00 <namex>
}
801031d7:	c9                   	leave  
801031d8:	c3                   	ret    
801031d9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

801031e0 <nameiparent>:

struct inode*
nameiparent(char *path, char *name)
{
801031e0:	f3 0f 1e fb          	endbr32 
801031e4:	55                   	push   %ebp
  return namex(path, 1, name);
801031e5:	ba 01 00 00 00       	mov    $0x1,%edx
{
801031ea:	89 e5                	mov    %esp,%ebp
  return namex(path, 1, name);
801031ec:	8b 4d 0c             	mov    0xc(%ebp),%ecx
801031ef:	8b 45 08             	mov    0x8(%ebp),%eax
}
801031f2:	5d                   	pop    %ebp
  return namex(path, 1, name);
801031f3:	e9 08 fd ff ff       	jmp    80102f00 <namex>
801031f8:	66 90                	xchg   %ax,%ax
801031fa:	66 90                	xchg   %ax,%ax
801031fc:	66 90                	xchg   %ax,%ax
801031fe:	66 90                	xchg   %ax,%ax

80103200 <binit>:
  struct buf head;
} bcache;

void
binit(void)
{
80103200:	f3 0f 1e fb          	endbr32 
80103204:	55                   	push   %ebp
80103205:	89 e5                	mov    %esp,%ebp
80103207:	53                   	push   %ebx

//PAGEBREAK!
  // Create linked list of buffers
  bcache.head.prev = &bcache.head;
  bcache.head.next = &bcache.head;
  for(b = bcache.buf; b < bcache.buf+NBUF; b++){
80103208:	bb f4 d6 10 80       	mov    $0x8010d6f4,%ebx
{
8010320d:	83 ec 0c             	sub    $0xc,%esp
  initlock(&bcache.lock, "bcache");
80103210:	68 13 77 10 80       	push   $0x80107713
80103215:	68 c0 d6 10 80       	push   $0x8010d6c0
8010321a:	e8 f1 d0 ff ff       	call   80100310 <initlock>
  bcache.head.next = &bcache.head;
8010321f:	83 c4 10             	add    $0x10,%esp
80103222:	b8 bc 1d 11 80       	mov    $0x80111dbc,%eax
  bcache.head.prev = &bcache.head;
80103227:	c7 05 0c 1e 11 80 bc 	movl   $0x80111dbc,0x80111e0c
8010322e:	1d 11 80 
  bcache.head.next = &bcache.head;
80103231:	c7 05 10 1e 11 80 bc 	movl   $0x80111dbc,0x80111e10
80103238:	1d 11 80 
  for(b = bcache.buf; b < bcache.buf+NBUF; b++){
8010323b:	eb 05                	jmp    80103242 <binit+0x42>
8010323d:	8d 76 00             	lea    0x0(%esi),%esi
80103240:	89 d3                	mov    %edx,%ebx
    b->next = bcache.head.next;
80103242:	89 43 54             	mov    %eax,0x54(%ebx)
    b->prev = &bcache.head;
    initsleeplock(&b->lock, "buffer");
80103245:	83 ec 08             	sub    $0x8,%esp
80103248:	8d 43 0c             	lea    0xc(%ebx),%eax
    b->prev = &bcache.head;
8010324b:	c7 43 50 bc 1d 11 80 	movl   $0x80111dbc,0x50(%ebx)
    initsleeplock(&b->lock, "buffer");
80103252:	68 1a 77 10 80       	push   $0x8010771a
80103257:	50                   	push   %eax
80103258:	e8 73 cf ff ff       	call   801001d0 <initsleeplock>
    bcache.head.next->prev = b;
8010325d:	a1 10 1e 11 80       	mov    0x80111e10,%eax
  for(b = bcache.buf; b < bcache.buf+NBUF; b++){
80103262:	8d 93 5c 02 00 00    	lea    0x25c(%ebx),%edx
80103268:	83 c4 10             	add    $0x10,%esp
    bcache.head.next->prev = b;
8010326b:	89 58 50             	mov    %ebx,0x50(%eax)
    bcache.head.next = b;
8010326e:	89 d8                	mov    %ebx,%eax
80103270:	89 1d 10 1e 11 80    	mov    %ebx,0x80111e10
  for(b = bcache.buf; b < bcache.buf+NBUF; b++){
80103276:	81 fb 60 1b 11 80    	cmp    $0x80111b60,%ebx
8010327c:	75 c2                	jne    80103240 <binit+0x40>
  }
}
8010327e:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80103281:	c9                   	leave  
80103282:	c3                   	ret    
80103283:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010328a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80103290 <bread>:
}

// Return a locked buf with the contents of the indicated block.
struct buf*
bread(uint dev, uint blockno)
{
80103290:	f3 0f 1e fb          	endbr32 
80103294:	55                   	push   %ebp
80103295:	89 e5                	mov    %esp,%ebp
80103297:	57                   	push   %edi
80103298:	56                   	push   %esi
80103299:	53                   	push   %ebx
8010329a:	83 ec 18             	sub    $0x18,%esp
8010329d:	8b 7d 08             	mov    0x8(%ebp),%edi
801032a0:	8b 75 0c             	mov    0xc(%ebp),%esi
  acquire(&bcache.lock);
801032a3:	68 c0 d6 10 80       	push   $0x8010d6c0
801032a8:	e8 e3 d1 ff ff       	call   80100490 <acquire>
  for(b = bcache.head.next; b != &bcache.head; b = b->next){
801032ad:	8b 1d 10 1e 11 80    	mov    0x80111e10,%ebx
801032b3:	83 c4 10             	add    $0x10,%esp
801032b6:	81 fb bc 1d 11 80    	cmp    $0x80111dbc,%ebx
801032bc:	75 0d                	jne    801032cb <bread+0x3b>
801032be:	eb 20                	jmp    801032e0 <bread+0x50>
801032c0:	8b 5b 54             	mov    0x54(%ebx),%ebx
801032c3:	81 fb bc 1d 11 80    	cmp    $0x80111dbc,%ebx
801032c9:	74 15                	je     801032e0 <bread+0x50>
    if(b->dev == dev && b->blockno == blockno){
801032cb:	3b 7b 04             	cmp    0x4(%ebx),%edi
801032ce:	75 f0                	jne    801032c0 <bread+0x30>
801032d0:	3b 73 08             	cmp    0x8(%ebx),%esi
801032d3:	75 eb                	jne    801032c0 <bread+0x30>
      b->refcnt++;
801032d5:	83 43 4c 01          	addl   $0x1,0x4c(%ebx)
      release(&bcache.lock);
801032d9:	eb 3f                	jmp    8010331a <bread+0x8a>
801032db:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801032df:	90                   	nop
  for(b = bcache.head.prev; b != &bcache.head; b = b->prev){
801032e0:	8b 1d 0c 1e 11 80    	mov    0x80111e0c,%ebx
801032e6:	81 fb bc 1d 11 80    	cmp    $0x80111dbc,%ebx
801032ec:	75 0d                	jne    801032fb <bread+0x6b>
801032ee:	eb 70                	jmp    80103360 <bread+0xd0>
801032f0:	8b 5b 50             	mov    0x50(%ebx),%ebx
801032f3:	81 fb bc 1d 11 80    	cmp    $0x80111dbc,%ebx
801032f9:	74 65                	je     80103360 <bread+0xd0>
    if(b->refcnt == 0 && (b->flags & B_DIRTY) == 0) {
801032fb:	8b 43 4c             	mov    0x4c(%ebx),%eax
801032fe:	85 c0                	test   %eax,%eax
80103300:	75 ee                	jne    801032f0 <bread+0x60>
80103302:	f6 03 04             	testb  $0x4,(%ebx)
80103305:	75 e9                	jne    801032f0 <bread+0x60>
      b->dev = dev;
80103307:	89 7b 04             	mov    %edi,0x4(%ebx)
      b->blockno = blockno;
8010330a:	89 73 08             	mov    %esi,0x8(%ebx)
      b->flags = 0;
8010330d:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
      b->refcnt = 1;
80103313:	c7 43 4c 01 00 00 00 	movl   $0x1,0x4c(%ebx)
      release(&bcache.lock);
8010331a:	83 ec 0c             	sub    $0xc,%esp
8010331d:	68 c0 d6 10 80       	push   $0x8010d6c0
80103322:	e8 29 d2 ff ff       	call   80100550 <release>
      acquiresleep(&b->lock);
80103327:	8d 43 0c             	lea    0xc(%ebx),%eax
8010332a:	89 04 24             	mov    %eax,(%esp)
8010332d:	e8 de ce ff ff       	call   80100210 <acquiresleep>
      return b;
80103332:	83 c4 10             	add    $0x10,%esp
  struct buf *b;

  b = bget(dev, blockno);
  if((b->flags & B_VALID) == 0) {
80103335:	f6 03 02             	testb  $0x2,(%ebx)
80103338:	74 0e                	je     80103348 <bread+0xb8>
    iderw(b);
  }
  return b;
}
8010333a:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010333d:	89 d8                	mov    %ebx,%eax
8010333f:	5b                   	pop    %ebx
80103340:	5e                   	pop    %esi
80103341:	5f                   	pop    %edi
80103342:	5d                   	pop    %ebp
80103343:	c3                   	ret    
80103344:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    iderw(b);
80103348:	83 ec 0c             	sub    $0xc,%esp
8010334b:	53                   	push   %ebx
8010334c:	e8 0f 03 00 00       	call   80103660 <iderw>
80103351:	83 c4 10             	add    $0x10,%esp
}
80103354:	8d 65 f4             	lea    -0xc(%ebp),%esp
80103357:	89 d8                	mov    %ebx,%eax
80103359:	5b                   	pop    %ebx
8010335a:	5e                   	pop    %esi
8010335b:	5f                   	pop    %edi
8010335c:	5d                   	pop    %ebp
8010335d:	c3                   	ret    
8010335e:	66 90                	xchg   %ax,%ax
  panic("bget: no buffers");
80103360:	83 ec 0c             	sub    $0xc,%esp
80103363:	68 21 77 10 80       	push   $0x80107721
80103368:	e8 53 e6 ff ff       	call   801019c0 <panic>
8010336d:	8d 76 00             	lea    0x0(%esi),%esi

80103370 <bwrite>:

// Write b's contents to disk.  Must be locked.
void
bwrite(struct buf *b)
{
80103370:	f3 0f 1e fb          	endbr32 
80103374:	55                   	push   %ebp
80103375:	89 e5                	mov    %esp,%ebp
80103377:	53                   	push   %ebx
80103378:	83 ec 10             	sub    $0x10,%esp
8010337b:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if(!holdingsleep(&b->lock))
8010337e:	8d 43 0c             	lea    0xc(%ebx),%eax
80103381:	50                   	push   %eax
80103382:	e8 29 cf ff ff       	call   801002b0 <holdingsleep>
80103387:	83 c4 10             	add    $0x10,%esp
8010338a:	85 c0                	test   %eax,%eax
8010338c:	74 0f                	je     8010339d <bwrite+0x2d>
    panic("bwrite");
  b->flags |= B_DIRTY;
8010338e:	83 0b 04             	orl    $0x4,(%ebx)
  iderw(b);
80103391:	89 5d 08             	mov    %ebx,0x8(%ebp)
}
80103394:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80103397:	c9                   	leave  
  iderw(b);
80103398:	e9 c3 02 00 00       	jmp    80103660 <iderw>
    panic("bwrite");
8010339d:	83 ec 0c             	sub    $0xc,%esp
801033a0:	68 32 77 10 80       	push   $0x80107732
801033a5:	e8 16 e6 ff ff       	call   801019c0 <panic>
801033aa:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801033b0 <brelse>:

// Release a locked buffer.
// Move to the head of the MRU list.
void
brelse(struct buf *b)
{
801033b0:	f3 0f 1e fb          	endbr32 
801033b4:	55                   	push   %ebp
801033b5:	89 e5                	mov    %esp,%ebp
801033b7:	56                   	push   %esi
801033b8:	53                   	push   %ebx
801033b9:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if(!holdingsleep(&b->lock))
801033bc:	8d 73 0c             	lea    0xc(%ebx),%esi
801033bf:	83 ec 0c             	sub    $0xc,%esp
801033c2:	56                   	push   %esi
801033c3:	e8 e8 ce ff ff       	call   801002b0 <holdingsleep>
801033c8:	83 c4 10             	add    $0x10,%esp
801033cb:	85 c0                	test   %eax,%eax
801033cd:	74 66                	je     80103435 <brelse+0x85>
    panic("brelse");

  releasesleep(&b->lock);
801033cf:	83 ec 0c             	sub    $0xc,%esp
801033d2:	56                   	push   %esi
801033d3:	e8 98 ce ff ff       	call   80100270 <releasesleep>

  acquire(&bcache.lock);
801033d8:	c7 04 24 c0 d6 10 80 	movl   $0x8010d6c0,(%esp)
801033df:	e8 ac d0 ff ff       	call   80100490 <acquire>
  b->refcnt--;
801033e4:	8b 43 4c             	mov    0x4c(%ebx),%eax
  if (b->refcnt == 0) {
801033e7:	83 c4 10             	add    $0x10,%esp
  b->refcnt--;
801033ea:	83 e8 01             	sub    $0x1,%eax
801033ed:	89 43 4c             	mov    %eax,0x4c(%ebx)
  if (b->refcnt == 0) {
801033f0:	85 c0                	test   %eax,%eax
801033f2:	75 2f                	jne    80103423 <brelse+0x73>
    // no one is waiting for it.
    b->next->prev = b->prev;
801033f4:	8b 43 54             	mov    0x54(%ebx),%eax
801033f7:	8b 53 50             	mov    0x50(%ebx),%edx
801033fa:	89 50 50             	mov    %edx,0x50(%eax)
    b->prev->next = b->next;
801033fd:	8b 43 50             	mov    0x50(%ebx),%eax
80103400:	8b 53 54             	mov    0x54(%ebx),%edx
80103403:	89 50 54             	mov    %edx,0x54(%eax)
    b->next = bcache.head.next;
80103406:	a1 10 1e 11 80       	mov    0x80111e10,%eax
    b->prev = &bcache.head;
8010340b:	c7 43 50 bc 1d 11 80 	movl   $0x80111dbc,0x50(%ebx)
    b->next = bcache.head.next;
80103412:	89 43 54             	mov    %eax,0x54(%ebx)
    bcache.head.next->prev = b;
80103415:	a1 10 1e 11 80       	mov    0x80111e10,%eax
8010341a:	89 58 50             	mov    %ebx,0x50(%eax)
    bcache.head.next = b;
8010341d:	89 1d 10 1e 11 80    	mov    %ebx,0x80111e10
  }
  
  release(&bcache.lock);
80103423:	c7 45 08 c0 d6 10 80 	movl   $0x8010d6c0,0x8(%ebp)
}
8010342a:	8d 65 f8             	lea    -0x8(%ebp),%esp
8010342d:	5b                   	pop    %ebx
8010342e:	5e                   	pop    %esi
8010342f:	5d                   	pop    %ebp
  release(&bcache.lock);
80103430:	e9 1b d1 ff ff       	jmp    80100550 <release>
    panic("brelse");
80103435:	83 ec 0c             	sub    $0xc,%esp
80103438:	68 39 77 10 80       	push   $0x80107739
8010343d:	e8 7e e5 ff ff       	call   801019c0 <panic>
80103442:	66 90                	xchg   %ax,%ax
80103444:	66 90                	xchg   %ax,%ax
80103446:	66 90                	xchg   %ax,%ax
80103448:	66 90                	xchg   %ax,%ax
8010344a:	66 90                	xchg   %ax,%ax
8010344c:	66 90                	xchg   %ax,%ax
8010344e:	66 90                	xchg   %ax,%ax

80103450 <idestart>:
}

// Start the request for b.  Caller must hold idelock.
static void
idestart(struct buf *b)
{
80103450:	55                   	push   %ebp
80103451:	89 e5                	mov    %esp,%ebp
80103453:	57                   	push   %edi
80103454:	56                   	push   %esi
80103455:	53                   	push   %ebx
80103456:	83 ec 0c             	sub    $0xc,%esp
  if(b == 0)
80103459:	85 c0                	test   %eax,%eax
8010345b:	0f 84 b4 00 00 00    	je     80103515 <idestart+0xc5>
    panic("idestart");
  if(b->blockno >= FSSIZE)
80103461:	8b 70 08             	mov    0x8(%eax),%esi
80103464:	89 c3                	mov    %eax,%ebx
80103466:	81 fe e7 03 00 00    	cmp    $0x3e7,%esi
8010346c:	0f 87 96 00 00 00    	ja     80103508 <idestart+0xb8>
80103472:	b9 f7 01 00 00       	mov    $0x1f7,%ecx
80103477:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010347e:	66 90                	xchg   %ax,%ax
80103480:	89 ca                	mov    %ecx,%edx
80103482:	ec                   	in     (%dx),%al
  while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
80103483:	83 e0 c0             	and    $0xffffffc0,%eax
80103486:	3c 40                	cmp    $0x40,%al
80103488:	75 f6                	jne    80103480 <idestart+0x30>
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010348a:	31 ff                	xor    %edi,%edi
8010348c:	ba f6 03 00 00       	mov    $0x3f6,%edx
80103491:	89 f8                	mov    %edi,%eax
80103493:	ee                   	out    %al,(%dx)
80103494:	b8 01 00 00 00       	mov    $0x1,%eax
80103499:	ba f2 01 00 00       	mov    $0x1f2,%edx
8010349e:	ee                   	out    %al,(%dx)
8010349f:	ba f3 01 00 00       	mov    $0x1f3,%edx
801034a4:	89 f0                	mov    %esi,%eax
801034a6:	ee                   	out    %al,(%dx)

  idewait(0);
  outb(0x3f6, 0);  // generate interrupt
  outb(0x1f2, sector_per_block);  // number of sectors
  outb(0x1f3, sector & 0xff);
  outb(0x1f4, (sector >> 8) & 0xff);
801034a7:	89 f0                	mov    %esi,%eax
801034a9:	ba f4 01 00 00       	mov    $0x1f4,%edx
801034ae:	c1 f8 08             	sar    $0x8,%eax
801034b1:	ee                   	out    %al,(%dx)
801034b2:	ba f5 01 00 00       	mov    $0x1f5,%edx
801034b7:	89 f8                	mov    %edi,%eax
801034b9:	ee                   	out    %al,(%dx)
  outb(0x1f5, (sector >> 16) & 0xff);
  outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f));
801034ba:	0f b6 43 04          	movzbl 0x4(%ebx),%eax
801034be:	ba f6 01 00 00       	mov    $0x1f6,%edx
801034c3:	c1 e0 04             	shl    $0x4,%eax
801034c6:	83 e0 10             	and    $0x10,%eax
801034c9:	83 c8 e0             	or     $0xffffffe0,%eax
801034cc:	ee                   	out    %al,(%dx)
  if(b->flags & B_DIRTY){
801034cd:	f6 03 04             	testb  $0x4,(%ebx)
801034d0:	75 16                	jne    801034e8 <idestart+0x98>
801034d2:	b8 20 00 00 00       	mov    $0x20,%eax
801034d7:	89 ca                	mov    %ecx,%edx
801034d9:	ee                   	out    %al,(%dx)
    outb(0x1f7, write_cmd);
    outsl(0x1f0, b->data, BSIZE/4);
  } else {
    outb(0x1f7, read_cmd);
  }
}
801034da:	8d 65 f4             	lea    -0xc(%ebp),%esp
801034dd:	5b                   	pop    %ebx
801034de:	5e                   	pop    %esi
801034df:	5f                   	pop    %edi
801034e0:	5d                   	pop    %ebp
801034e1:	c3                   	ret    
801034e2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
801034e8:	b8 30 00 00 00       	mov    $0x30,%eax
801034ed:	89 ca                	mov    %ecx,%edx
801034ef:	ee                   	out    %al,(%dx)
  asm volatile("cld; rep outsl" :
801034f0:	b9 80 00 00 00       	mov    $0x80,%ecx
    outsl(0x1f0, b->data, BSIZE/4);
801034f5:	8d 73 5c             	lea    0x5c(%ebx),%esi
801034f8:	ba f0 01 00 00       	mov    $0x1f0,%edx
801034fd:	fc                   	cld    
801034fe:	f3 6f                	rep outsl %ds:(%esi),(%dx)
}
80103500:	8d 65 f4             	lea    -0xc(%ebp),%esp
80103503:	5b                   	pop    %ebx
80103504:	5e                   	pop    %esi
80103505:	5f                   	pop    %edi
80103506:	5d                   	pop    %ebp
80103507:	c3                   	ret    
    panic("incorrect blockno");
80103508:	83 ec 0c             	sub    $0xc,%esp
8010350b:	68 49 77 10 80       	push   $0x80107749
80103510:	e8 ab e4 ff ff       	call   801019c0 <panic>
    panic("idestart");
80103515:	83 ec 0c             	sub    $0xc,%esp
80103518:	68 40 77 10 80       	push   $0x80107740
8010351d:	e8 9e e4 ff ff       	call   801019c0 <panic>
80103522:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103529:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80103530 <ideinit>:
{
80103530:	f3 0f 1e fb          	endbr32 
80103534:	55                   	push   %ebp
80103535:	89 e5                	mov    %esp,%ebp
80103537:	83 ec 10             	sub    $0x10,%esp
  initlock(&idelock, "ide");
8010353a:	68 5b 77 10 80       	push   $0x8010775b
8010353f:	68 a0 98 10 80       	push   $0x801098a0
80103544:	e8 c7 cd ff ff       	call   80100310 <initlock>
  ioapicenable(IRQ_IDE, ncpu - 1);
80103549:	58                   	pop    %eax
8010354a:	a1 a0 ae 10 80       	mov    0x8010aea0,%eax
8010354f:	5a                   	pop    %edx
80103550:	83 e8 01             	sub    $0x1,%eax
80103553:	50                   	push   %eax
80103554:	6a 0e                	push   $0xe
80103556:	e8 15 d1 ff ff       	call   80100670 <ioapicenable>
  while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
8010355b:	83 c4 10             	add    $0x10,%esp
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010355e:	ba f7 01 00 00       	mov    $0x1f7,%edx
80103563:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80103567:	90                   	nop
80103568:	ec                   	in     (%dx),%al
80103569:	83 e0 c0             	and    $0xffffffc0,%eax
8010356c:	3c 40                	cmp    $0x40,%al
8010356e:	75 f8                	jne    80103568 <ideinit+0x38>
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80103570:	b8 f0 ff ff ff       	mov    $0xfffffff0,%eax
80103575:	ba f6 01 00 00       	mov    $0x1f6,%edx
8010357a:	ee                   	out    %al,(%dx)
8010357b:	b9 e8 03 00 00       	mov    $0x3e8,%ecx
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80103580:	ba f7 01 00 00       	mov    $0x1f7,%edx
80103585:	eb 0e                	jmp    80103595 <ideinit+0x65>
80103587:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010358e:	66 90                	xchg   %ax,%ax
  for(i=0; i<1000; i++){
80103590:	83 e9 01             	sub    $0x1,%ecx
80103593:	74 0f                	je     801035a4 <ideinit+0x74>
80103595:	ec                   	in     (%dx),%al
    if(inb(0x1f7) != 0){
80103596:	84 c0                	test   %al,%al
80103598:	74 f6                	je     80103590 <ideinit+0x60>
      havedisk1 = 1;
8010359a:	c7 05 80 98 10 80 01 	movl   $0x1,0x80109880
801035a1:	00 00 00 
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
801035a4:	b8 e0 ff ff ff       	mov    $0xffffffe0,%eax
801035a9:	ba f6 01 00 00       	mov    $0x1f6,%edx
801035ae:	ee                   	out    %al,(%dx)
}
801035af:	c9                   	leave  
801035b0:	c3                   	ret    
801035b1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801035b8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801035bf:	90                   	nop

801035c0 <ideintr>:

// Interrupt handler.
void
ideintr(void)
{
801035c0:	f3 0f 1e fb          	endbr32 
801035c4:	55                   	push   %ebp
801035c5:	89 e5                	mov    %esp,%ebp
801035c7:	57                   	push   %edi
801035c8:	56                   	push   %esi
801035c9:	53                   	push   %ebx
801035ca:	83 ec 18             	sub    $0x18,%esp
  struct buf *b;

  // First queued buffer is the active request.
  acquire(&idelock);
801035cd:	68 a0 98 10 80       	push   $0x801098a0
801035d2:	e8 b9 ce ff ff       	call   80100490 <acquire>

  if((b = idequeue) == 0){
801035d7:	8b 1d 84 98 10 80    	mov    0x80109884,%ebx
801035dd:	83 c4 10             	add    $0x10,%esp
801035e0:	85 db                	test   %ebx,%ebx
801035e2:	74 5f                	je     80103643 <ideintr+0x83>
    release(&idelock);
    return;
  }
  idequeue = b->qnext;
801035e4:	8b 43 58             	mov    0x58(%ebx),%eax
801035e7:	a3 84 98 10 80       	mov    %eax,0x80109884

  // Read data if needed.
  if(!(b->flags & B_DIRTY) && idewait(1) >= 0)
801035ec:	8b 33                	mov    (%ebx),%esi
801035ee:	f7 c6 04 00 00 00    	test   $0x4,%esi
801035f4:	75 2b                	jne    80103621 <ideintr+0x61>
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801035f6:	ba f7 01 00 00       	mov    $0x1f7,%edx
801035fb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801035ff:	90                   	nop
80103600:	ec                   	in     (%dx),%al
  while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
80103601:	89 c1                	mov    %eax,%ecx
80103603:	83 e1 c0             	and    $0xffffffc0,%ecx
80103606:	80 f9 40             	cmp    $0x40,%cl
80103609:	75 f5                	jne    80103600 <ideintr+0x40>
  if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0)
8010360b:	a8 21                	test   $0x21,%al
8010360d:	75 12                	jne    80103621 <ideintr+0x61>
    insl(0x1f0, b->data, BSIZE/4);
8010360f:	8d 7b 5c             	lea    0x5c(%ebx),%edi
  asm volatile("cld; rep insl" :
80103612:	b9 80 00 00 00       	mov    $0x80,%ecx
80103617:	ba f0 01 00 00       	mov    $0x1f0,%edx
8010361c:	fc                   	cld    
8010361d:	f3 6d                	rep insl (%dx),%es:(%edi)
8010361f:	8b 33                	mov    (%ebx),%esi

  // Wake process waiting for this buf.
  b->flags |= B_VALID;
  b->flags &= ~B_DIRTY;
80103621:	83 e6 fb             	and    $0xfffffffb,%esi
  wakeup(b);
80103624:	83 ec 0c             	sub    $0xc,%esp
  b->flags &= ~B_DIRTY;
80103627:	83 ce 02             	or     $0x2,%esi
8010362a:	89 33                	mov    %esi,(%ebx)
  wakeup(b);
8010362c:	53                   	push   %ebx
8010362d:	e8 ee 0a 00 00       	call   80104120 <wakeup>

  // Start disk on next buf in queue.
  if(idequeue != 0)
80103632:	a1 84 98 10 80       	mov    0x80109884,%eax
80103637:	83 c4 10             	add    $0x10,%esp
8010363a:	85 c0                	test   %eax,%eax
8010363c:	74 05                	je     80103643 <ideintr+0x83>
    idestart(idequeue);
8010363e:	e8 0d fe ff ff       	call   80103450 <idestart>
    release(&idelock);
80103643:	83 ec 0c             	sub    $0xc,%esp
80103646:	68 a0 98 10 80       	push   $0x801098a0
8010364b:	e8 00 cf ff ff       	call   80100550 <release>

  release(&idelock);
}
80103650:	8d 65 f4             	lea    -0xc(%ebp),%esp
80103653:	5b                   	pop    %ebx
80103654:	5e                   	pop    %esi
80103655:	5f                   	pop    %edi
80103656:	5d                   	pop    %ebp
80103657:	c3                   	ret    
80103658:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010365f:	90                   	nop

80103660 <iderw>:
// Sync buf with disk.
// If B_DIRTY is set, write buf to disk, clear B_DIRTY, set B_VALID.
// Else if B_VALID is not set, read buf from disk, set B_VALID.
void
iderw(struct buf *b)
{
80103660:	f3 0f 1e fb          	endbr32 
80103664:	55                   	push   %ebp
80103665:	89 e5                	mov    %esp,%ebp
80103667:	53                   	push   %ebx
80103668:	83 ec 10             	sub    $0x10,%esp
8010366b:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct buf **pp;

  if(!holdingsleep(&b->lock))
8010366e:	8d 43 0c             	lea    0xc(%ebx),%eax
80103671:	50                   	push   %eax
80103672:	e8 39 cc ff ff       	call   801002b0 <holdingsleep>
80103677:	83 c4 10             	add    $0x10,%esp
8010367a:	85 c0                	test   %eax,%eax
8010367c:	0f 84 cf 00 00 00    	je     80103751 <iderw+0xf1>
    panic("iderw: buf not locked");
  if((b->flags & (B_VALID|B_DIRTY)) == B_VALID)
80103682:	8b 03                	mov    (%ebx),%eax
80103684:	83 e0 06             	and    $0x6,%eax
80103687:	83 f8 02             	cmp    $0x2,%eax
8010368a:	0f 84 b4 00 00 00    	je     80103744 <iderw+0xe4>
    panic("iderw: nothing to do");
  if(b->dev != 0 && !havedisk1)
80103690:	8b 53 04             	mov    0x4(%ebx),%edx
80103693:	85 d2                	test   %edx,%edx
80103695:	74 0d                	je     801036a4 <iderw+0x44>
80103697:	a1 80 98 10 80       	mov    0x80109880,%eax
8010369c:	85 c0                	test   %eax,%eax
8010369e:	0f 84 93 00 00 00    	je     80103737 <iderw+0xd7>
    panic("iderw: ide disk 1 not present");

  acquire(&idelock);  //DOC:acquire-lock
801036a4:	83 ec 0c             	sub    $0xc,%esp
801036a7:	68 a0 98 10 80       	push   $0x801098a0
801036ac:	e8 df cd ff ff       	call   80100490 <acquire>

  // Append b to idequeue.
  b->qnext = 0;
  for(pp=&idequeue; *pp; pp=&(*pp)->qnext)  //DOC:insert-queue
801036b1:	a1 84 98 10 80       	mov    0x80109884,%eax
  b->qnext = 0;
801036b6:	c7 43 58 00 00 00 00 	movl   $0x0,0x58(%ebx)
  for(pp=&idequeue; *pp; pp=&(*pp)->qnext)  //DOC:insert-queue
801036bd:	83 c4 10             	add    $0x10,%esp
801036c0:	85 c0                	test   %eax,%eax
801036c2:	74 6c                	je     80103730 <iderw+0xd0>
801036c4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801036c8:	89 c2                	mov    %eax,%edx
801036ca:	8b 40 58             	mov    0x58(%eax),%eax
801036cd:	85 c0                	test   %eax,%eax
801036cf:	75 f7                	jne    801036c8 <iderw+0x68>
801036d1:	83 c2 58             	add    $0x58,%edx
    ;
  *pp = b;
801036d4:	89 1a                	mov    %ebx,(%edx)

  // Start disk if necessary.
  if(idequeue == b)
801036d6:	39 1d 84 98 10 80    	cmp    %ebx,0x80109884
801036dc:	74 42                	je     80103720 <iderw+0xc0>
    idestart(b);

  // Wait for request to finish.
  while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
801036de:	8b 03                	mov    (%ebx),%eax
801036e0:	83 e0 06             	and    $0x6,%eax
801036e3:	83 f8 02             	cmp    $0x2,%eax
801036e6:	74 23                	je     8010370b <iderw+0xab>
801036e8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801036ef:	90                   	nop
    sleep(b, &idelock);
801036f0:	83 ec 08             	sub    $0x8,%esp
801036f3:	68 a0 98 10 80       	push   $0x801098a0
801036f8:	53                   	push   %ebx
801036f9:	e8 62 08 00 00       	call   80103f60 <sleep>
  while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
801036fe:	8b 03                	mov    (%ebx),%eax
80103700:	83 c4 10             	add    $0x10,%esp
80103703:	83 e0 06             	and    $0x6,%eax
80103706:	83 f8 02             	cmp    $0x2,%eax
80103709:	75 e5                	jne    801036f0 <iderw+0x90>
  }


  release(&idelock);
8010370b:	c7 45 08 a0 98 10 80 	movl   $0x801098a0,0x8(%ebp)
}
80103712:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80103715:	c9                   	leave  
  release(&idelock);
80103716:	e9 35 ce ff ff       	jmp    80100550 <release>
8010371b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010371f:	90                   	nop
    idestart(b);
80103720:	89 d8                	mov    %ebx,%eax
80103722:	e8 29 fd ff ff       	call   80103450 <idestart>
80103727:	eb b5                	jmp    801036de <iderw+0x7e>
80103729:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  for(pp=&idequeue; *pp; pp=&(*pp)->qnext)  //DOC:insert-queue
80103730:	ba 84 98 10 80       	mov    $0x80109884,%edx
80103735:	eb 9d                	jmp    801036d4 <iderw+0x74>
    panic("iderw: ide disk 1 not present");
80103737:	83 ec 0c             	sub    $0xc,%esp
8010373a:	68 8a 77 10 80       	push   $0x8010778a
8010373f:	e8 7c e2 ff ff       	call   801019c0 <panic>
    panic("iderw: nothing to do");
80103744:	83 ec 0c             	sub    $0xc,%esp
80103747:	68 75 77 10 80       	push   $0x80107775
8010374c:	e8 6f e2 ff ff       	call   801019c0 <panic>
    panic("iderw: buf not locked");
80103751:	83 ec 0c             	sub    $0xc,%esp
80103754:	68 5f 77 10 80       	push   $0x8010775f
80103759:	e8 62 e2 ff ff       	call   801019c0 <panic>
8010375e:	66 90                	xchg   %ax,%ax

80103760 <allocproc>:
// If found, change state to EMBRYO and initialize
// state required to run in the kernel.
// Otherwise return 0.
static struct proc*
allocproc(void)
{
80103760:	55                   	push   %ebp
80103761:	89 e5                	mov    %esp,%ebp
80103763:	53                   	push   %ebx
  struct proc *p;
  char *sp;
  
  acquire(&ptable.lock);

  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103764:	bb 54 20 11 80       	mov    $0x80112054,%ebx
{
80103769:	83 ec 10             	sub    $0x10,%esp
  acquire(&ptable.lock);
8010376c:	68 20 20 11 80       	push   $0x80112020
80103771:	e8 1a cd ff ff       	call   80100490 <acquire>
80103776:	83 c4 10             	add    $0x10,%esp
80103779:	eb 17                	jmp    80103792 <allocproc+0x32>
8010377b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010377f:	90                   	nop
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103780:	81 c3 84 00 00 00    	add    $0x84,%ebx
80103786:	81 fb 54 41 11 80    	cmp    $0x80114154,%ebx
8010378c:	0f 84 7e 00 00 00    	je     80103810 <allocproc+0xb0>
    if(p->state == UNUSED)
80103792:	8b 43 0c             	mov    0xc(%ebx),%eax
80103795:	85 c0                	test   %eax,%eax
80103797:	75 e7                	jne    80103780 <allocproc+0x20>
  release(&ptable.lock);
  return 0;

found:
  p->state = EMBRYO;
  p->pid = nextpid++;
80103799:	a1 08 93 10 80       	mov    0x80109308,%eax
  p ->ticket = 10; 
  release(&ptable.lock);
8010379e:	83 ec 0c             	sub    $0xc,%esp
  p->state = EMBRYO;
801037a1:	c7 43 0c 01 00 00 00 	movl   $0x1,0xc(%ebx)
  p ->ticket = 10; 
801037a8:	c7 43 7c 0a 00 00 00 	movl   $0xa,0x7c(%ebx)
  p->pid = nextpid++;
801037af:	89 43 10             	mov    %eax,0x10(%ebx)
801037b2:	8d 50 01             	lea    0x1(%eax),%edx
  release(&ptable.lock);
801037b5:	68 20 20 11 80       	push   $0x80112020
  p->pid = nextpid++;
801037ba:	89 15 08 93 10 80    	mov    %edx,0x80109308
  release(&ptable.lock);
801037c0:	e8 8b cd ff ff       	call   80100550 <release>

  // Allocate kernel stack.
  if((p->kstack = kalloc()) == 0){
801037c5:	e8 96 19 00 00       	call   80105160 <kalloc>
801037ca:	83 c4 10             	add    $0x10,%esp
801037cd:	89 43 08             	mov    %eax,0x8(%ebx)
801037d0:	85 c0                	test   %eax,%eax
801037d2:	74 55                	je     80103829 <allocproc+0xc9>
    return 0;
  }
  sp = p->kstack + KSTACKSIZE;

  // Leave room for trap frame.
  sp -= sizeof *p->tf;
801037d4:	8d 90 b4 0f 00 00    	lea    0xfb4(%eax),%edx
  sp -= 4;
  *(uint*)sp = (uint)trapret;

  sp -= sizeof *p->context;
  p->context = (struct context*)sp;
  memset(p->context, 0, sizeof *p->context);
801037da:	83 ec 04             	sub    $0x4,%esp
  sp -= sizeof *p->context;
801037dd:	05 9c 0f 00 00       	add    $0xf9c,%eax
  sp -= sizeof *p->tf;
801037e2:	89 53 18             	mov    %edx,0x18(%ebx)
  *(uint*)sp = (uint)trapret;
801037e5:	c7 40 14 9f 64 10 80 	movl   $0x8010649f,0x14(%eax)
  p->context = (struct context*)sp;
801037ec:	89 43 1c             	mov    %eax,0x1c(%ebx)
  memset(p->context, 0, sizeof *p->context);
801037ef:	6a 14                	push   $0x14
801037f1:	6a 00                	push   $0x0
801037f3:	50                   	push   %eax
801037f4:	e8 d7 19 00 00       	call   801051d0 <memset>
  p->context->eip = (uint)forkret;
801037f9:	8b 43 1c             	mov    0x1c(%ebx),%eax

  return p;
801037fc:	83 c4 10             	add    $0x10,%esp
  p->context->eip = (uint)forkret;
801037ff:	c7 40 10 40 38 10 80 	movl   $0x80103840,0x10(%eax)
}
80103806:	89 d8                	mov    %ebx,%eax
80103808:	8b 5d fc             	mov    -0x4(%ebp),%ebx
8010380b:	c9                   	leave  
8010380c:	c3                   	ret    
8010380d:	8d 76 00             	lea    0x0(%esi),%esi
  release(&ptable.lock);
80103810:	83 ec 0c             	sub    $0xc,%esp
  return 0;
80103813:	31 db                	xor    %ebx,%ebx
  release(&ptable.lock);
80103815:	68 20 20 11 80       	push   $0x80112020
8010381a:	e8 31 cd ff ff       	call   80100550 <release>
}
8010381f:	89 d8                	mov    %ebx,%eax
  return 0;
80103821:	83 c4 10             	add    $0x10,%esp
}
80103824:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80103827:	c9                   	leave  
80103828:	c3                   	ret    
    p->state = UNUSED;
80103829:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
    return 0;
80103830:	31 db                	xor    %ebx,%ebx
}
80103832:	89 d8                	mov    %ebx,%eax
80103834:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80103837:	c9                   	leave  
80103838:	c3                   	ret    
80103839:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80103840 <forkret>:

// A fork child's very first scheduling by scheduler()
// will swtch here.  "Return" to user space.
void
forkret(void)
{
80103840:	f3 0f 1e fb          	endbr32 
80103844:	55                   	push   %ebp
80103845:	89 e5                	mov    %esp,%ebp
80103847:	83 ec 14             	sub    $0x14,%esp
  static int first = 1;
  // Still holding ptable.lock from scheduler.
  release(&ptable.lock);
8010384a:	68 20 20 11 80       	push   $0x80112020
8010384f:	e8 fc cc ff ff       	call   80100550 <release>

  if (first) {
80103854:	a1 00 93 10 80       	mov    0x80109300,%eax
80103859:	83 c4 10             	add    $0x10,%esp
8010385c:	85 c0                	test   %eax,%eax
8010385e:	75 08                	jne    80103868 <forkret+0x28>
    iinit(ROOTDEV);
    initlog(ROOTDEV);
  }

  // Return to "caller", actually trapret (see allocproc).
}
80103860:	c9                   	leave  
80103861:	c3                   	ret    
80103862:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    first = 0;
80103868:	c7 05 00 93 10 80 00 	movl   $0x0,0x80109300
8010386f:	00 00 00 
    iinit(ROOTDEV);
80103872:	83 ec 0c             	sub    $0xc,%esp
80103875:	6a 01                	push   $0x1
80103877:	e8 54 ee ff ff       	call   801026d0 <iinit>
    initlog(ROOTDEV);
8010387c:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
80103883:	e8 78 d5 ff ff       	call   80100e00 <initlog>
}
80103888:	83 c4 10             	add    $0x10,%esp
8010388b:	c9                   	leave  
8010388c:	c3                   	ret    
8010388d:	8d 76 00             	lea    0x0(%esi),%esi

80103890 <pinit>:
{
80103890:	f3 0f 1e fb          	endbr32 
80103894:	55                   	push   %ebp
80103895:	89 e5                	mov    %esp,%ebp
80103897:	83 ec 10             	sub    $0x10,%esp
  initlock(&ptable.lock, "ptable");
8010389a:	68 a8 77 10 80       	push   $0x801077a8
8010389f:	68 20 20 11 80       	push   $0x80112020
801038a4:	e8 67 ca ff ff       	call   80100310 <initlock>
}
801038a9:	83 c4 10             	add    $0x10,%esp
801038ac:	c9                   	leave  
801038ad:	c3                   	ret    
801038ae:	66 90                	xchg   %ax,%ax

801038b0 <mycpu>:
{
801038b0:	f3 0f 1e fb          	endbr32 
801038b4:	55                   	push   %ebp
801038b5:	89 e5                	mov    %esp,%ebp
801038b7:	56                   	push   %esi
801038b8:	53                   	push   %ebx
  asm volatile("pushfl; popl %0" : "=r" (eflags));
801038b9:	9c                   	pushf  
801038ba:	58                   	pop    %eax
  if(readeflags()&FL_IF)
801038bb:	f6 c4 02             	test   $0x2,%ah
801038be:	75 4a                	jne    8010390a <mycpu+0x5a>
  apicid = lapicid();
801038c0:	e8 eb ce ff ff       	call   801007b0 <lapicid>
  for (i = 0; i < ncpu; ++i) {
801038c5:	8b 35 a0 ae 10 80    	mov    0x8010aea0,%esi
  apicid = lapicid();
801038cb:	89 c3                	mov    %eax,%ebx
  for (i = 0; i < ncpu; ++i) {
801038cd:	85 f6                	test   %esi,%esi
801038cf:	7e 2c                	jle    801038fd <mycpu+0x4d>
801038d1:	31 d2                	xor    %edx,%edx
801038d3:	eb 0a                	jmp    801038df <mycpu+0x2f>
801038d5:	8d 76 00             	lea    0x0(%esi),%esi
801038d8:	83 c2 01             	add    $0x1,%edx
801038db:	39 f2                	cmp    %esi,%edx
801038dd:	74 1e                	je     801038fd <mycpu+0x4d>
    if (cpus[i].apicid == apicid)
801038df:	69 ca b0 00 00 00    	imul   $0xb0,%edx,%ecx
801038e5:	0f b6 81 20 a9 10 80 	movzbl -0x7fef56e0(%ecx),%eax
801038ec:	39 d8                	cmp    %ebx,%eax
801038ee:	75 e8                	jne    801038d8 <mycpu+0x28>
}
801038f0:	8d 65 f8             	lea    -0x8(%ebp),%esp
      return &cpus[i];
801038f3:	8d 81 20 a9 10 80    	lea    -0x7fef56e0(%ecx),%eax
}
801038f9:	5b                   	pop    %ebx
801038fa:	5e                   	pop    %esi
801038fb:	5d                   	pop    %ebp
801038fc:	c3                   	ret    
  panic("unknown apicid\n");
801038fd:	83 ec 0c             	sub    $0xc,%esp
80103900:	68 af 77 10 80       	push   $0x801077af
80103905:	e8 b6 e0 ff ff       	call   801019c0 <panic>
    panic("mycpu called with interrupts enabled\n");
8010390a:	83 ec 0c             	sub    $0xc,%esp
8010390d:	68 8c 78 10 80       	push   $0x8010788c
80103912:	e8 a9 e0 ff ff       	call   801019c0 <panic>
80103917:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010391e:	66 90                	xchg   %ax,%ax

80103920 <cpuid>:
cpuid() {
80103920:	f3 0f 1e fb          	endbr32 
80103924:	55                   	push   %ebp
80103925:	89 e5                	mov    %esp,%ebp
80103927:	83 ec 08             	sub    $0x8,%esp
  return mycpu()-cpus;
8010392a:	e8 81 ff ff ff       	call   801038b0 <mycpu>
}
8010392f:	c9                   	leave  
  return mycpu()-cpus;
80103930:	2d 20 a9 10 80       	sub    $0x8010a920,%eax
80103935:	c1 f8 04             	sar    $0x4,%eax
80103938:	69 c0 a3 8b 2e ba    	imul   $0xba2e8ba3,%eax,%eax
}
8010393e:	c3                   	ret    
8010393f:	90                   	nop

80103940 <myproc>:
myproc(void) {
80103940:	f3 0f 1e fb          	endbr32 
80103944:	55                   	push   %ebp
80103945:	89 e5                	mov    %esp,%ebp
80103947:	53                   	push   %ebx
80103948:	83 ec 04             	sub    $0x4,%esp
  pushcli();
8010394b:	e8 40 ca ff ff       	call   80100390 <pushcli>
  c = mycpu();
80103950:	e8 5b ff ff ff       	call   801038b0 <mycpu>
  p = c->proc;
80103955:	8b 98 ac 00 00 00    	mov    0xac(%eax),%ebx
  popcli();
8010395b:	e8 80 ca ff ff       	call   801003e0 <popcli>
}
80103960:	83 c4 04             	add    $0x4,%esp
80103963:	89 d8                	mov    %ebx,%eax
80103965:	5b                   	pop    %ebx
80103966:	5d                   	pop    %ebp
80103967:	c3                   	ret    
80103968:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010396f:	90                   	nop

80103970 <userinit>:
{
80103970:	f3 0f 1e fb          	endbr32 
80103974:	55                   	push   %ebp
80103975:	89 e5                	mov    %esp,%ebp
80103977:	53                   	push   %ebx
80103978:	83 ec 04             	sub    $0x4,%esp
  p = allocproc();
8010397b:	e8 e0 fd ff ff       	call   80103760 <allocproc>
80103980:	89 c3                	mov    %eax,%ebx
  initproc = p;
80103982:	a3 d4 98 10 80       	mov    %eax,0x801098d4
  if((p->pgdir = setupkvm()) == 0)
80103987:	e8 84 13 00 00       	call   80104d10 <setupkvm>
8010398c:	89 43 04             	mov    %eax,0x4(%ebx)
8010398f:	85 c0                	test   %eax,%eax
80103991:	0f 84 bd 00 00 00    	je     80103a54 <userinit+0xe4>
  inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size);
80103997:	83 ec 04             	sub    $0x4,%esp
8010399a:	68 2c 00 00 00       	push   $0x2c
8010399f:	68 60 97 10 80       	push   $0x80109760
801039a4:	50                   	push   %eax
801039a5:	e8 36 10 00 00       	call   801049e0 <inituvm>
  memset(p->tf, 0, sizeof(*p->tf));
801039aa:	83 c4 0c             	add    $0xc,%esp
  p->sz = PGSIZE;
801039ad:	c7 03 00 10 00 00    	movl   $0x1000,(%ebx)
  memset(p->tf, 0, sizeof(*p->tf));
801039b3:	6a 4c                	push   $0x4c
801039b5:	6a 00                	push   $0x0
801039b7:	ff 73 18             	pushl  0x18(%ebx)
801039ba:	e8 11 18 00 00       	call   801051d0 <memset>
  p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
801039bf:	8b 43 18             	mov    0x18(%ebx),%eax
801039c2:	ba 1b 00 00 00       	mov    $0x1b,%edx
  safestrcpy(p->name, "initcode", sizeof(p->name));
801039c7:	83 c4 0c             	add    $0xc,%esp
  p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
801039ca:	b9 23 00 00 00       	mov    $0x23,%ecx
  p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
801039cf:	66 89 50 3c          	mov    %dx,0x3c(%eax)
  p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
801039d3:	8b 43 18             	mov    0x18(%ebx),%eax
801039d6:	66 89 48 2c          	mov    %cx,0x2c(%eax)
  p->tf->es = p->tf->ds;
801039da:	8b 43 18             	mov    0x18(%ebx),%eax
801039dd:	0f b7 50 2c          	movzwl 0x2c(%eax),%edx
801039e1:	66 89 50 28          	mov    %dx,0x28(%eax)
  p->tf->ss = p->tf->ds;
801039e5:	8b 43 18             	mov    0x18(%ebx),%eax
801039e8:	0f b7 50 2c          	movzwl 0x2c(%eax),%edx
801039ec:	66 89 50 48          	mov    %dx,0x48(%eax)
  p->tf->eflags = FL_IF;
801039f0:	8b 43 18             	mov    0x18(%ebx),%eax
801039f3:	c7 40 40 00 02 00 00 	movl   $0x200,0x40(%eax)
  p->tf->esp = PGSIZE;
801039fa:	8b 43 18             	mov    0x18(%ebx),%eax
801039fd:	c7 40 44 00 10 00 00 	movl   $0x1000,0x44(%eax)
  p->tf->eip = 0;  // beginning of initcode.S
80103a04:	8b 43 18             	mov    0x18(%ebx),%eax
80103a07:	c7 40 38 00 00 00 00 	movl   $0x0,0x38(%eax)
  safestrcpy(p->name, "initcode", sizeof(p->name));
80103a0e:	8d 43 6c             	lea    0x6c(%ebx),%eax
80103a11:	6a 10                	push   $0x10
80103a13:	68 d8 77 10 80       	push   $0x801077d8
80103a18:	50                   	push   %eax
80103a19:	e8 72 19 00 00       	call   80105390 <safestrcpy>
  p->cwd = namei("/");
80103a1e:	c7 04 24 e1 77 10 80 	movl   $0x801077e1,(%esp)
80103a25:	e8 96 f7 ff ff       	call   801031c0 <namei>
80103a2a:	89 43 68             	mov    %eax,0x68(%ebx)
  acquire(&ptable.lock);
80103a2d:	c7 04 24 20 20 11 80 	movl   $0x80112020,(%esp)
80103a34:	e8 57 ca ff ff       	call   80100490 <acquire>
  p->state = RUNNABLE;
80103a39:	c7 43 0c 03 00 00 00 	movl   $0x3,0xc(%ebx)
  release(&ptable.lock);
80103a40:	c7 04 24 20 20 11 80 	movl   $0x80112020,(%esp)
80103a47:	e8 04 cb ff ff       	call   80100550 <release>
}
80103a4c:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80103a4f:	83 c4 10             	add    $0x10,%esp
80103a52:	c9                   	leave  
80103a53:	c3                   	ret    
    panic("userinit: out of memory?");
80103a54:	83 ec 0c             	sub    $0xc,%esp
80103a57:	68 bf 77 10 80       	push   $0x801077bf
80103a5c:	e8 5f df ff ff       	call   801019c0 <panic>
80103a61:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103a68:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103a6f:	90                   	nop

80103a70 <growproc>:
{
80103a70:	f3 0f 1e fb          	endbr32 
80103a74:	55                   	push   %ebp
80103a75:	89 e5                	mov    %esp,%ebp
80103a77:	56                   	push   %esi
80103a78:	53                   	push   %ebx
80103a79:	8b 75 08             	mov    0x8(%ebp),%esi
  pushcli();
80103a7c:	e8 0f c9 ff ff       	call   80100390 <pushcli>
  c = mycpu();
80103a81:	e8 2a fe ff ff       	call   801038b0 <mycpu>
  p = c->proc;
80103a86:	8b 98 ac 00 00 00    	mov    0xac(%eax),%ebx
  popcli();
80103a8c:	e8 4f c9 ff ff       	call   801003e0 <popcli>
  sz = curproc->sz;
80103a91:	8b 03                	mov    (%ebx),%eax
  if(n > 0){
80103a93:	85 f6                	test   %esi,%esi
80103a95:	7f 19                	jg     80103ab0 <growproc+0x40>
  } else if(n < 0){
80103a97:	75 37                	jne    80103ad0 <growproc+0x60>
  switchuvm(curproc);
80103a99:	83 ec 0c             	sub    $0xc,%esp
  curproc->sz = sz;
80103a9c:	89 03                	mov    %eax,(%ebx)
  switchuvm(curproc);
80103a9e:	53                   	push   %ebx
80103a9f:	e8 2c 0e 00 00       	call   801048d0 <switchuvm>
  return 0;
80103aa4:	83 c4 10             	add    $0x10,%esp
80103aa7:	31 c0                	xor    %eax,%eax
}
80103aa9:	8d 65 f8             	lea    -0x8(%ebp),%esp
80103aac:	5b                   	pop    %ebx
80103aad:	5e                   	pop    %esi
80103aae:	5d                   	pop    %ebp
80103aaf:	c3                   	ret    
    if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0)
80103ab0:	83 ec 04             	sub    $0x4,%esp
80103ab3:	01 c6                	add    %eax,%esi
80103ab5:	56                   	push   %esi
80103ab6:	50                   	push   %eax
80103ab7:	ff 73 04             	pushl  0x4(%ebx)
80103aba:	e8 71 10 00 00       	call   80104b30 <allocuvm>
80103abf:	83 c4 10             	add    $0x10,%esp
80103ac2:	85 c0                	test   %eax,%eax
80103ac4:	75 d3                	jne    80103a99 <growproc+0x29>
      return -1;
80103ac6:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80103acb:	eb dc                	jmp    80103aa9 <growproc+0x39>
80103acd:	8d 76 00             	lea    0x0(%esi),%esi
    if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0)
80103ad0:	83 ec 04             	sub    $0x4,%esp
80103ad3:	01 c6                	add    %eax,%esi
80103ad5:	56                   	push   %esi
80103ad6:	50                   	push   %eax
80103ad7:	ff 73 04             	pushl  0x4(%ebx)
80103ada:	e8 81 11 00 00       	call   80104c60 <deallocuvm>
80103adf:	83 c4 10             	add    $0x10,%esp
80103ae2:	85 c0                	test   %eax,%eax
80103ae4:	75 b3                	jne    80103a99 <growproc+0x29>
80103ae6:	eb de                	jmp    80103ac6 <growproc+0x56>
80103ae8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103aef:	90                   	nop

80103af0 <fork>:
{
80103af0:	f3 0f 1e fb          	endbr32 
80103af4:	55                   	push   %ebp
80103af5:	89 e5                	mov    %esp,%ebp
80103af7:	57                   	push   %edi
80103af8:	56                   	push   %esi
80103af9:	53                   	push   %ebx
80103afa:	83 ec 1c             	sub    $0x1c,%esp
  pushcli();
80103afd:	e8 8e c8 ff ff       	call   80100390 <pushcli>
  c = mycpu();
80103b02:	e8 a9 fd ff ff       	call   801038b0 <mycpu>
  p = c->proc;
80103b07:	8b 98 ac 00 00 00    	mov    0xac(%eax),%ebx
  popcli();
80103b0d:	e8 ce c8 ff ff       	call   801003e0 <popcli>
  if((np = allocproc()) == 0){
80103b12:	e8 49 fc ff ff       	call   80103760 <allocproc>
80103b17:	89 45 e4             	mov    %eax,-0x1c(%ebp)
80103b1a:	85 c0                	test   %eax,%eax
80103b1c:	0f 84 c1 00 00 00    	je     80103be3 <fork+0xf3>
  if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){
80103b22:	83 ec 08             	sub    $0x8,%esp
80103b25:	ff 33                	pushl  (%ebx)
80103b27:	89 c7                	mov    %eax,%edi
80103b29:	ff 73 04             	pushl  0x4(%ebx)
80103b2c:	e8 af 12 00 00       	call   80104de0 <copyuvm>
80103b31:	83 c4 10             	add    $0x10,%esp
80103b34:	89 47 04             	mov    %eax,0x4(%edi)
80103b37:	85 c0                	test   %eax,%eax
80103b39:	0f 84 ab 00 00 00    	je     80103bea <fork+0xfa>
  np->sz = curproc->sz;
80103b3f:	8b 03                	mov    (%ebx),%eax
80103b41:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
80103b44:	89 01                	mov    %eax,(%ecx)
  *np->tf = *curproc->tf;
80103b46:	8b 79 18             	mov    0x18(%ecx),%edi
  np->parent = curproc;
80103b49:	89 c8                	mov    %ecx,%eax
80103b4b:	89 59 14             	mov    %ebx,0x14(%ecx)
  *np->tf = *curproc->tf;
80103b4e:	b9 13 00 00 00       	mov    $0x13,%ecx
80103b53:	8b 73 18             	mov    0x18(%ebx),%esi
80103b56:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  for(i = 0; i < NOFILE; i++)
80103b58:	31 f6                	xor    %esi,%esi
  np->tf->eax = 0;
80103b5a:	8b 40 18             	mov    0x18(%eax),%eax
80103b5d:	c7 40 1c 00 00 00 00 	movl   $0x0,0x1c(%eax)
  for(i = 0; i < NOFILE; i++)
80103b64:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    if(curproc->ofile[i])
80103b68:	8b 44 b3 28          	mov    0x28(%ebx,%esi,4),%eax
80103b6c:	85 c0                	test   %eax,%eax
80103b6e:	74 13                	je     80103b83 <fork+0x93>
      np->ofile[i] = filedup(curproc->ofile[i]);
80103b70:	83 ec 0c             	sub    $0xc,%esp
80103b73:	50                   	push   %eax
80103b74:	e8 67 d6 ff ff       	call   801011e0 <filedup>
80103b79:	8b 55 e4             	mov    -0x1c(%ebp),%edx
80103b7c:	83 c4 10             	add    $0x10,%esp
80103b7f:	89 44 b2 28          	mov    %eax,0x28(%edx,%esi,4)
  for(i = 0; i < NOFILE; i++)
80103b83:	83 c6 01             	add    $0x1,%esi
80103b86:	83 fe 10             	cmp    $0x10,%esi
80103b89:	75 dd                	jne    80103b68 <fork+0x78>
  np->cwd = idup(curproc->cwd);
80103b8b:	83 ec 0c             	sub    $0xc,%esp
80103b8e:	ff 73 68             	pushl  0x68(%ebx)
  safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103b91:	83 c3 6c             	add    $0x6c,%ebx
  np->cwd = idup(curproc->cwd);
80103b94:	e8 27 ed ff ff       	call   801028c0 <idup>
80103b99:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103b9c:	83 c4 0c             	add    $0xc,%esp
  np->cwd = idup(curproc->cwd);
80103b9f:	89 47 68             	mov    %eax,0x68(%edi)
  np->ticket = curproc->ticket;
80103ba2:	8b 43 10             	mov    0x10(%ebx),%eax
80103ba5:	89 47 7c             	mov    %eax,0x7c(%edi)
  safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103ba8:	8d 47 6c             	lea    0x6c(%edi),%eax
80103bab:	6a 10                	push   $0x10
80103bad:	53                   	push   %ebx
80103bae:	50                   	push   %eax
80103baf:	e8 dc 17 00 00       	call   80105390 <safestrcpy>
  pid = np->pid;
80103bb4:	8b 5f 10             	mov    0x10(%edi),%ebx
  acquire(&ptable.lock);
80103bb7:	c7 04 24 20 20 11 80 	movl   $0x80112020,(%esp)
80103bbe:	e8 cd c8 ff ff       	call   80100490 <acquire>
  np->state = RUNNABLE;
80103bc3:	c7 47 0c 03 00 00 00 	movl   $0x3,0xc(%edi)
  release(&ptable.lock);
80103bca:	c7 04 24 20 20 11 80 	movl   $0x80112020,(%esp)
80103bd1:	e8 7a c9 ff ff       	call   80100550 <release>
  return pid;
80103bd6:	83 c4 10             	add    $0x10,%esp
}
80103bd9:	8d 65 f4             	lea    -0xc(%ebp),%esp
80103bdc:	89 d8                	mov    %ebx,%eax
80103bde:	5b                   	pop    %ebx
80103bdf:	5e                   	pop    %esi
80103be0:	5f                   	pop    %edi
80103be1:	5d                   	pop    %ebp
80103be2:	c3                   	ret    
    return -1;
80103be3:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
80103be8:	eb ef                	jmp    80103bd9 <fork+0xe9>
    kfree(np->kstack);
80103bea:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
80103bed:	83 ec 0c             	sub    $0xc,%esp
80103bf0:	ff 73 08             	pushl  0x8(%ebx)
80103bf3:	e8 a8 13 00 00       	call   80104fa0 <kfree>
    np->kstack = 0;
80103bf8:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
    return -1;
80103bff:	83 c4 10             	add    $0x10,%esp
    np->state = UNUSED;
80103c02:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
    return -1;
80103c09:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
80103c0e:	eb c9                	jmp    80103bd9 <fork+0xe9>

80103c10 <scheduler>:
{
80103c10:	f3 0f 1e fb          	endbr32 
80103c14:	55                   	push   %ebp
80103c15:	89 e5                	mov    %esp,%ebp
80103c17:	57                   	push   %edi
80103c18:	56                   	push   %esi
80103c19:	53                   	push   %ebx
80103c1a:	83 ec 0c             	sub    $0xc,%esp
  struct cpu *c = mycpu();
80103c1d:	e8 8e fc ff ff       	call   801038b0 <mycpu>
  c->proc = 0;
80103c22:	c7 80 ac 00 00 00 00 	movl   $0x0,0xac(%eax)
80103c29:	00 00 00 
  struct cpu *c = mycpu();
80103c2c:	89 c3                	mov    %eax,%ebx
  c->proc = 0;
80103c2e:	8d 70 04             	lea    0x4(%eax),%esi
80103c31:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  asm volatile("sti");
80103c38:	fb                   	sti    
    acquire(&ptable.lock);
80103c39:	83 ec 0c             	sub    $0xc,%esp
80103c3c:	68 20 20 11 80       	push   $0x80112020
80103c41:	e8 4a c8 ff ff       	call   80100490 <acquire>
80103c46:	83 c4 10             	add    $0x10,%esp
    int total = 0; 
80103c49:	31 c9                	xor    %ecx,%ecx
    for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103c4b:	b8 54 20 11 80       	mov    $0x80112054,%eax
        if(p->state==RUNNABLE && p->ticket >0)
80103c50:	83 78 0c 03          	cmpl   $0x3,0xc(%eax)
80103c54:	75 0b                	jne    80103c61 <scheduler+0x51>
80103c56:	8b 50 7c             	mov    0x7c(%eax),%edx
        	total+=p->ticket;
80103c59:	8d 3c 11             	lea    (%ecx,%edx,1),%edi
80103c5c:	85 d2                	test   %edx,%edx
80103c5e:	0f 4f cf             	cmovg  %edi,%ecx
    for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103c61:	05 84 00 00 00       	add    $0x84,%eax
80103c66:	3d 54 41 11 80       	cmp    $0x80114154,%eax
80103c6b:	75 e3                	jne    80103c50 <scheduler+0x40>
    if (total ==0){
80103c6d:	85 c9                	test   %ecx,%ecx
80103c6f:	75 12                	jne    80103c83 <scheduler+0x73>
	release(&ptable.lock);
80103c71:	83 ec 0c             	sub    $0xc,%esp
80103c74:	68 20 20 11 80       	push   $0x80112020
80103c79:	e8 d2 c8 ff ff       	call   80100550 <release>
	continue; 
80103c7e:	83 c4 10             	add    $0x10,%esp
80103c81:	eb b5                	jmp    80103c38 <scheduler+0x28>
	rnd_seed = rnd_seed * 1103515245U + 12345U;
80103c83:	69 05 04 93 10 80 6d 	imul   $0x41c64e6d,0x80109304,%eax
80103c8a:	4e c6 41 
	uint ures = high % (uint)range;
80103c8d:	31 d2                	xor    %edx,%edx
    for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 
80103c8f:	bf 54 20 11 80       	mov    $0x80112054,%edi
	rnd_seed = rnd_seed * 1103515245U + 12345U;
80103c94:	05 39 30 00 00       	add    $0x3039,%eax
80103c99:	a3 04 93 10 80       	mov    %eax,0x80109304
	uint high = rnd_seed >> 16; 
80103c9e:	c1 e8 10             	shr    $0x10,%eax
	uint ures = high % (uint)range;
80103ca1:	f7 f1                	div    %ecx
    int cumlative = 0 ;
80103ca3:	31 c9                	xor    %ecx,%ecx
80103ca5:	eb 17                	jmp    80103cbe <scheduler+0xae>
80103ca7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103cae:	66 90                	xchg   %ax,%ax
    for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ 
80103cb0:	81 c7 84 00 00 00    	add    $0x84,%edi
80103cb6:	81 ff 54 41 11 80    	cmp    $0x80114154,%edi
80103cbc:	74 b3                	je     80103c71 <scheduler+0x61>
	if(p->state!=RUNNABLE || p->ticket <0)
80103cbe:	83 7f 0c 03          	cmpl   $0x3,0xc(%edi)
80103cc2:	75 ec                	jne    80103cb0 <scheduler+0xa0>
80103cc4:	8b 47 7c             	mov    0x7c(%edi),%eax
80103cc7:	85 c0                	test   %eax,%eax
80103cc9:	78 e5                	js     80103cb0 <scheduler+0xa0>
	cumlative += p->ticket;
80103ccb:	01 c1                	add    %eax,%ecx
	if (cumlative > winner) {
80103ccd:	39 d1                	cmp    %edx,%ecx
80103ccf:	7e df                	jle    80103cb0 <scheduler+0xa0>
		switchuvm(p);
80103cd1:	83 ec 0c             	sub    $0xc,%esp
		c->proc = p;
80103cd4:	89 bb ac 00 00 00    	mov    %edi,0xac(%ebx)
		switchuvm(p);
80103cda:	57                   	push   %edi
80103cdb:	e8 f0 0b 00 00       	call   801048d0 <switchuvm>
		p->state = RUNNING; 
80103ce0:	c7 47 0c 04 00 00 00 	movl   $0x4,0xc(%edi)
		swtch(&(c->scheduler), p->context);
80103ce7:	58                   	pop    %eax
80103ce8:	5a                   	pop    %edx
80103ce9:	ff 77 1c             	pushl  0x1c(%edi)
80103cec:	56                   	push   %esi
80103ced:	e8 01 17 00 00       	call   801053f3 <swtch>
      		switchkvm();
80103cf2:	e8 b9 0b 00 00       	call   801048b0 <switchkvm>
      		break;
80103cf7:	83 c4 10             	add    $0x10,%esp
      		c->proc = 0;
80103cfa:	c7 83 ac 00 00 00 00 	movl   $0x0,0xac(%ebx)
80103d01:	00 00 00 
      		break;
80103d04:	e9 68 ff ff ff       	jmp    80103c71 <scheduler+0x61>
80103d09:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80103d10 <sched>:
{
80103d10:	f3 0f 1e fb          	endbr32 
80103d14:	55                   	push   %ebp
80103d15:	89 e5                	mov    %esp,%ebp
80103d17:	56                   	push   %esi
80103d18:	53                   	push   %ebx
  pushcli();
80103d19:	e8 72 c6 ff ff       	call   80100390 <pushcli>
  c = mycpu();
80103d1e:	e8 8d fb ff ff       	call   801038b0 <mycpu>
  p = c->proc;
80103d23:	8b 98 ac 00 00 00    	mov    0xac(%eax),%ebx
  popcli();
80103d29:	e8 b2 c6 ff ff       	call   801003e0 <popcli>
  if(!holding(&ptable.lock))
80103d2e:	83 ec 0c             	sub    $0xc,%esp
80103d31:	68 20 20 11 80       	push   $0x80112020
80103d36:	e8 05 c7 ff ff       	call   80100440 <holding>
80103d3b:	83 c4 10             	add    $0x10,%esp
80103d3e:	85 c0                	test   %eax,%eax
80103d40:	74 4f                	je     80103d91 <sched+0x81>
  if(mycpu()->ncli != 1)
80103d42:	e8 69 fb ff ff       	call   801038b0 <mycpu>
80103d47:	83 b8 a4 00 00 00 01 	cmpl   $0x1,0xa4(%eax)
80103d4e:	75 68                	jne    80103db8 <sched+0xa8>
  if(p->state == RUNNING)
80103d50:	83 7b 0c 04          	cmpl   $0x4,0xc(%ebx)
80103d54:	74 55                	je     80103dab <sched+0x9b>
  asm volatile("pushfl; popl %0" : "=r" (eflags));
80103d56:	9c                   	pushf  
80103d57:	58                   	pop    %eax
  if(readeflags()&FL_IF)
80103d58:	f6 c4 02             	test   $0x2,%ah
80103d5b:	75 41                	jne    80103d9e <sched+0x8e>
  intena = mycpu()->intena;
80103d5d:	e8 4e fb ff ff       	call   801038b0 <mycpu>
  swtch(&p->context, mycpu()->scheduler);
80103d62:	83 c3 1c             	add    $0x1c,%ebx
  intena = mycpu()->intena;
80103d65:	8b b0 a8 00 00 00    	mov    0xa8(%eax),%esi
  swtch(&p->context, mycpu()->scheduler);
80103d6b:	e8 40 fb ff ff       	call   801038b0 <mycpu>
80103d70:	83 ec 08             	sub    $0x8,%esp
80103d73:	ff 70 04             	pushl  0x4(%eax)
80103d76:	53                   	push   %ebx
80103d77:	e8 77 16 00 00       	call   801053f3 <swtch>
  mycpu()->intena = intena;
80103d7c:	e8 2f fb ff ff       	call   801038b0 <mycpu>
}
80103d81:	83 c4 10             	add    $0x10,%esp
  mycpu()->intena = intena;
80103d84:	89 b0 a8 00 00 00    	mov    %esi,0xa8(%eax)
}
80103d8a:	8d 65 f8             	lea    -0x8(%ebp),%esp
80103d8d:	5b                   	pop    %ebx
80103d8e:	5e                   	pop    %esi
80103d8f:	5d                   	pop    %ebp
80103d90:	c3                   	ret    
    panic("sched ptable.lock");
80103d91:	83 ec 0c             	sub    $0xc,%esp
80103d94:	68 e3 77 10 80       	push   $0x801077e3
80103d99:	e8 22 dc ff ff       	call   801019c0 <panic>
    panic("sched interruptible");
80103d9e:	83 ec 0c             	sub    $0xc,%esp
80103da1:	68 0f 78 10 80       	push   $0x8010780f
80103da6:	e8 15 dc ff ff       	call   801019c0 <panic>
    panic("sched running");
80103dab:	83 ec 0c             	sub    $0xc,%esp
80103dae:	68 01 78 10 80       	push   $0x80107801
80103db3:	e8 08 dc ff ff       	call   801019c0 <panic>
    panic("sched locks");
80103db8:	83 ec 0c             	sub    $0xc,%esp
80103dbb:	68 f5 77 10 80       	push   $0x801077f5
80103dc0:	e8 fb db ff ff       	call   801019c0 <panic>
80103dc5:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103dcc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80103dd0 <exit>:
{
80103dd0:	f3 0f 1e fb          	endbr32 
80103dd4:	55                   	push   %ebp
80103dd5:	89 e5                	mov    %esp,%ebp
80103dd7:	57                   	push   %edi
80103dd8:	56                   	push   %esi
80103dd9:	53                   	push   %ebx
80103dda:	83 ec 0c             	sub    $0xc,%esp
  pushcli();
80103ddd:	e8 ae c5 ff ff       	call   80100390 <pushcli>
  c = mycpu();
80103de2:	e8 c9 fa ff ff       	call   801038b0 <mycpu>
  p = c->proc;
80103de7:	8b b0 ac 00 00 00    	mov    0xac(%eax),%esi
  popcli();
80103ded:	e8 ee c5 ff ff       	call   801003e0 <popcli>
  if(curproc == initproc)
80103df2:	8d 5e 28             	lea    0x28(%esi),%ebx
80103df5:	8d 7e 68             	lea    0x68(%esi),%edi
80103df8:	39 35 d4 98 10 80    	cmp    %esi,0x801098d4
80103dfe:	0f 84 fd 00 00 00    	je     80103f01 <exit+0x131>
80103e04:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    if(curproc->ofile[fd]){
80103e08:	8b 03                	mov    (%ebx),%eax
80103e0a:	85 c0                	test   %eax,%eax
80103e0c:	74 12                	je     80103e20 <exit+0x50>
      fileclose(curproc->ofile[fd]);
80103e0e:	83 ec 0c             	sub    $0xc,%esp
80103e11:	50                   	push   %eax
80103e12:	e8 19 d4 ff ff       	call   80101230 <fileclose>
      curproc->ofile[fd] = 0;
80103e17:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
80103e1d:	83 c4 10             	add    $0x10,%esp
  for(fd = 0; fd < NOFILE; fd++){
80103e20:	83 c3 04             	add    $0x4,%ebx
80103e23:	39 df                	cmp    %ebx,%edi
80103e25:	75 e1                	jne    80103e08 <exit+0x38>
  begin_op();
80103e27:	e8 74 d0 ff ff       	call   80100ea0 <begin_op>
  iput(curproc->cwd);
80103e2c:	83 ec 0c             	sub    $0xc,%esp
80103e2f:	ff 76 68             	pushl  0x68(%esi)
80103e32:	e8 e9 eb ff ff       	call   80102a20 <iput>
  end_op();
80103e37:	e8 d4 d0 ff ff       	call   80100f10 <end_op>
  curproc->cwd = 0;
80103e3c:	c7 46 68 00 00 00 00 	movl   $0x0,0x68(%esi)
  acquire(&ptable.lock);
80103e43:	c7 04 24 20 20 11 80 	movl   $0x80112020,(%esp)
80103e4a:	e8 41 c6 ff ff       	call   80100490 <acquire>
  wakeup1(curproc->parent);
80103e4f:	8b 56 14             	mov    0x14(%esi),%edx
80103e52:	83 c4 10             	add    $0x10,%esp
static void
wakeup1(void *chan)
{
  struct proc *p;

  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103e55:	b8 54 20 11 80       	mov    $0x80112054,%eax
80103e5a:	eb 10                	jmp    80103e6c <exit+0x9c>
80103e5c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80103e60:	05 84 00 00 00       	add    $0x84,%eax
80103e65:	3d 54 41 11 80       	cmp    $0x80114154,%eax
80103e6a:	74 1e                	je     80103e8a <exit+0xba>
    if(p->state == SLEEPING && p->chan == chan)
80103e6c:	83 78 0c 02          	cmpl   $0x2,0xc(%eax)
80103e70:	75 ee                	jne    80103e60 <exit+0x90>
80103e72:	3b 50 20             	cmp    0x20(%eax),%edx
80103e75:	75 e9                	jne    80103e60 <exit+0x90>
      p->state = RUNNABLE;
80103e77:	c7 40 0c 03 00 00 00 	movl   $0x3,0xc(%eax)
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103e7e:	05 84 00 00 00       	add    $0x84,%eax
80103e83:	3d 54 41 11 80       	cmp    $0x80114154,%eax
80103e88:	75 e2                	jne    80103e6c <exit+0x9c>
      p->parent = initproc;
80103e8a:	8b 0d d4 98 10 80    	mov    0x801098d4,%ecx
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80103e90:	ba 54 20 11 80       	mov    $0x80112054,%edx
80103e95:	eb 17                	jmp    80103eae <exit+0xde>
80103e97:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103e9e:	66 90                	xchg   %ax,%ax
80103ea0:	81 c2 84 00 00 00    	add    $0x84,%edx
80103ea6:	81 fa 54 41 11 80    	cmp    $0x80114154,%edx
80103eac:	74 3a                	je     80103ee8 <exit+0x118>
    if(p->parent == curproc){
80103eae:	39 72 14             	cmp    %esi,0x14(%edx)
80103eb1:	75 ed                	jne    80103ea0 <exit+0xd0>
      if(p->state == ZOMBIE)
80103eb3:	83 7a 0c 05          	cmpl   $0x5,0xc(%edx)
      p->parent = initproc;
80103eb7:	89 4a 14             	mov    %ecx,0x14(%edx)
      if(p->state == ZOMBIE)
80103eba:	75 e4                	jne    80103ea0 <exit+0xd0>
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103ebc:	b8 54 20 11 80       	mov    $0x80112054,%eax
80103ec1:	eb 11                	jmp    80103ed4 <exit+0x104>
80103ec3:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80103ec7:	90                   	nop
80103ec8:	05 84 00 00 00       	add    $0x84,%eax
80103ecd:	3d 54 41 11 80       	cmp    $0x80114154,%eax
80103ed2:	74 cc                	je     80103ea0 <exit+0xd0>
    if(p->state == SLEEPING && p->chan == chan)
80103ed4:	83 78 0c 02          	cmpl   $0x2,0xc(%eax)
80103ed8:	75 ee                	jne    80103ec8 <exit+0xf8>
80103eda:	3b 48 20             	cmp    0x20(%eax),%ecx
80103edd:	75 e9                	jne    80103ec8 <exit+0xf8>
      p->state = RUNNABLE;
80103edf:	c7 40 0c 03 00 00 00 	movl   $0x3,0xc(%eax)
80103ee6:	eb e0                	jmp    80103ec8 <exit+0xf8>
  curproc->state = ZOMBIE;
80103ee8:	c7 46 0c 05 00 00 00 	movl   $0x5,0xc(%esi)
  sched();
80103eef:	e8 1c fe ff ff       	call   80103d10 <sched>
  panic("zombie exit");
80103ef4:	83 ec 0c             	sub    $0xc,%esp
80103ef7:	68 30 78 10 80       	push   $0x80107830
80103efc:	e8 bf da ff ff       	call   801019c0 <panic>
    panic("init exiting");
80103f01:	83 ec 0c             	sub    $0xc,%esp
80103f04:	68 23 78 10 80       	push   $0x80107823
80103f09:	e8 b2 da ff ff       	call   801019c0 <panic>
80103f0e:	66 90                	xchg   %ax,%ax

80103f10 <yield>:
{
80103f10:	f3 0f 1e fb          	endbr32 
80103f14:	55                   	push   %ebp
80103f15:	89 e5                	mov    %esp,%ebp
80103f17:	53                   	push   %ebx
80103f18:	83 ec 10             	sub    $0x10,%esp
  acquire(&ptable.lock);  //DOC: yieldlock
80103f1b:	68 20 20 11 80       	push   $0x80112020
80103f20:	e8 6b c5 ff ff       	call   80100490 <acquire>
  pushcli();
80103f25:	e8 66 c4 ff ff       	call   80100390 <pushcli>
  c = mycpu();
80103f2a:	e8 81 f9 ff ff       	call   801038b0 <mycpu>
  p = c->proc;
80103f2f:	8b 98 ac 00 00 00    	mov    0xac(%eax),%ebx
  popcli();
80103f35:	e8 a6 c4 ff ff       	call   801003e0 <popcli>
  myproc()->state = RUNNABLE;
80103f3a:	c7 43 0c 03 00 00 00 	movl   $0x3,0xc(%ebx)
  sched();
80103f41:	e8 ca fd ff ff       	call   80103d10 <sched>
  release(&ptable.lock);
80103f46:	c7 04 24 20 20 11 80 	movl   $0x80112020,(%esp)
80103f4d:	e8 fe c5 ff ff       	call   80100550 <release>
}
80103f52:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80103f55:	83 c4 10             	add    $0x10,%esp
80103f58:	c9                   	leave  
80103f59:	c3                   	ret    
80103f5a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80103f60 <sleep>:
{
80103f60:	f3 0f 1e fb          	endbr32 
80103f64:	55                   	push   %ebp
80103f65:	89 e5                	mov    %esp,%ebp
80103f67:	57                   	push   %edi
80103f68:	56                   	push   %esi
80103f69:	53                   	push   %ebx
80103f6a:	83 ec 0c             	sub    $0xc,%esp
80103f6d:	8b 7d 08             	mov    0x8(%ebp),%edi
80103f70:	8b 75 0c             	mov    0xc(%ebp),%esi
  pushcli();
80103f73:	e8 18 c4 ff ff       	call   80100390 <pushcli>
  c = mycpu();
80103f78:	e8 33 f9 ff ff       	call   801038b0 <mycpu>
  p = c->proc;
80103f7d:	8b 98 ac 00 00 00    	mov    0xac(%eax),%ebx
  popcli();
80103f83:	e8 58 c4 ff ff       	call   801003e0 <popcli>
  if(p == 0)
80103f88:	85 db                	test   %ebx,%ebx
80103f8a:	0f 84 83 00 00 00    	je     80104013 <sleep+0xb3>
  if(lk == 0)
80103f90:	85 f6                	test   %esi,%esi
80103f92:	74 72                	je     80104006 <sleep+0xa6>
  if(lk != &ptable.lock){  //DOC: sleeplock0
80103f94:	81 fe 20 20 11 80    	cmp    $0x80112020,%esi
80103f9a:	74 4c                	je     80103fe8 <sleep+0x88>
    acquire(&ptable.lock);  //DOC: sleeplock1
80103f9c:	83 ec 0c             	sub    $0xc,%esp
80103f9f:	68 20 20 11 80       	push   $0x80112020
80103fa4:	e8 e7 c4 ff ff       	call   80100490 <acquire>
    release(lk);
80103fa9:	89 34 24             	mov    %esi,(%esp)
80103fac:	e8 9f c5 ff ff       	call   80100550 <release>
  p->chan = chan;
80103fb1:	89 7b 20             	mov    %edi,0x20(%ebx)
  p->state = SLEEPING;
80103fb4:	c7 43 0c 02 00 00 00 	movl   $0x2,0xc(%ebx)
  sched();
80103fbb:	e8 50 fd ff ff       	call   80103d10 <sched>
  p->chan = 0;
80103fc0:	c7 43 20 00 00 00 00 	movl   $0x0,0x20(%ebx)
    release(&ptable.lock);
80103fc7:	c7 04 24 20 20 11 80 	movl   $0x80112020,(%esp)
80103fce:	e8 7d c5 ff ff       	call   80100550 <release>
    acquire(lk);
80103fd3:	89 75 08             	mov    %esi,0x8(%ebp)
80103fd6:	83 c4 10             	add    $0x10,%esp
}
80103fd9:	8d 65 f4             	lea    -0xc(%ebp),%esp
80103fdc:	5b                   	pop    %ebx
80103fdd:	5e                   	pop    %esi
80103fde:	5f                   	pop    %edi
80103fdf:	5d                   	pop    %ebp
    acquire(lk);
80103fe0:	e9 ab c4 ff ff       	jmp    80100490 <acquire>
80103fe5:	8d 76 00             	lea    0x0(%esi),%esi
  p->chan = chan;
80103fe8:	89 7b 20             	mov    %edi,0x20(%ebx)
  p->state = SLEEPING;
80103feb:	c7 43 0c 02 00 00 00 	movl   $0x2,0xc(%ebx)
  sched();
80103ff2:	e8 19 fd ff ff       	call   80103d10 <sched>
  p->chan = 0;
80103ff7:	c7 43 20 00 00 00 00 	movl   $0x0,0x20(%ebx)
}
80103ffe:	8d 65 f4             	lea    -0xc(%ebp),%esp
80104001:	5b                   	pop    %ebx
80104002:	5e                   	pop    %esi
80104003:	5f                   	pop    %edi
80104004:	5d                   	pop    %ebp
80104005:	c3                   	ret    
    panic("sleep without lk");
80104006:	83 ec 0c             	sub    $0xc,%esp
80104009:	68 42 78 10 80       	push   $0x80107842
8010400e:	e8 ad d9 ff ff       	call   801019c0 <panic>
    panic("sleep");
80104013:	83 ec 0c             	sub    $0xc,%esp
80104016:	68 3c 78 10 80       	push   $0x8010783c
8010401b:	e8 a0 d9 ff ff       	call   801019c0 <panic>

80104020 <wait>:
{
80104020:	f3 0f 1e fb          	endbr32 
80104024:	55                   	push   %ebp
80104025:	89 e5                	mov    %esp,%ebp
80104027:	56                   	push   %esi
80104028:	53                   	push   %ebx
  pushcli();
80104029:	e8 62 c3 ff ff       	call   80100390 <pushcli>
  c = mycpu();
8010402e:	e8 7d f8 ff ff       	call   801038b0 <mycpu>
  p = c->proc;
80104033:	8b b0 ac 00 00 00    	mov    0xac(%eax),%esi
  popcli();
80104039:	e8 a2 c3 ff ff       	call   801003e0 <popcli>
  acquire(&ptable.lock);
8010403e:	83 ec 0c             	sub    $0xc,%esp
80104041:	68 20 20 11 80       	push   $0x80112020
80104046:	e8 45 c4 ff ff       	call   80100490 <acquire>
8010404b:	83 c4 10             	add    $0x10,%esp
    havekids = 0;
8010404e:	31 c0                	xor    %eax,%eax
    for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104050:	bb 54 20 11 80       	mov    $0x80112054,%ebx
80104055:	eb 17                	jmp    8010406e <wait+0x4e>
80104057:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010405e:	66 90                	xchg   %ax,%ax
80104060:	81 c3 84 00 00 00    	add    $0x84,%ebx
80104066:	81 fb 54 41 11 80    	cmp    $0x80114154,%ebx
8010406c:	74 1e                	je     8010408c <wait+0x6c>
      if(p->parent != curproc)
8010406e:	39 73 14             	cmp    %esi,0x14(%ebx)
80104071:	75 ed                	jne    80104060 <wait+0x40>
      if(p->state == ZOMBIE){
80104073:	83 7b 0c 05          	cmpl   $0x5,0xc(%ebx)
80104077:	74 37                	je     801040b0 <wait+0x90>
    for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104079:	81 c3 84 00 00 00    	add    $0x84,%ebx
      havekids = 1;
8010407f:	b8 01 00 00 00       	mov    $0x1,%eax
    for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104084:	81 fb 54 41 11 80    	cmp    $0x80114154,%ebx
8010408a:	75 e2                	jne    8010406e <wait+0x4e>
    if(!havekids || curproc->killed){
8010408c:	85 c0                	test   %eax,%eax
8010408e:	74 76                	je     80104106 <wait+0xe6>
80104090:	8b 46 24             	mov    0x24(%esi),%eax
80104093:	85 c0                	test   %eax,%eax
80104095:	75 6f                	jne    80104106 <wait+0xe6>
    sleep(curproc, &ptable.lock);  //DOC: wait-sleep
80104097:	83 ec 08             	sub    $0x8,%esp
8010409a:	68 20 20 11 80       	push   $0x80112020
8010409f:	56                   	push   %esi
801040a0:	e8 bb fe ff ff       	call   80103f60 <sleep>
    havekids = 0;
801040a5:	83 c4 10             	add    $0x10,%esp
801040a8:	eb a4                	jmp    8010404e <wait+0x2e>
801040aa:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
        kfree(p->kstack);
801040b0:	83 ec 0c             	sub    $0xc,%esp
801040b3:	ff 73 08             	pushl  0x8(%ebx)
        pid = p->pid;
801040b6:	8b 73 10             	mov    0x10(%ebx),%esi
        kfree(p->kstack);
801040b9:	e8 e2 0e 00 00       	call   80104fa0 <kfree>
        freevm(p->pgdir);
801040be:	5a                   	pop    %edx
801040bf:	ff 73 04             	pushl  0x4(%ebx)
        p->kstack = 0;
801040c2:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
        freevm(p->pgdir);
801040c9:	e8 c2 0b 00 00       	call   80104c90 <freevm>
        release(&ptable.lock);
801040ce:	c7 04 24 20 20 11 80 	movl   $0x80112020,(%esp)
        p->pid = 0;
801040d5:	c7 43 10 00 00 00 00 	movl   $0x0,0x10(%ebx)
        p->parent = 0;
801040dc:	c7 43 14 00 00 00 00 	movl   $0x0,0x14(%ebx)
        p->name[0] = 0;
801040e3:	c6 43 6c 00          	movb   $0x0,0x6c(%ebx)
        p->killed = 0;
801040e7:	c7 43 24 00 00 00 00 	movl   $0x0,0x24(%ebx)
        p->state = UNUSED;
801040ee:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
        release(&ptable.lock);
801040f5:	e8 56 c4 ff ff       	call   80100550 <release>
        return pid;
801040fa:	83 c4 10             	add    $0x10,%esp
}
801040fd:	8d 65 f8             	lea    -0x8(%ebp),%esp
80104100:	89 f0                	mov    %esi,%eax
80104102:	5b                   	pop    %ebx
80104103:	5e                   	pop    %esi
80104104:	5d                   	pop    %ebp
80104105:	c3                   	ret    
      release(&ptable.lock);
80104106:	83 ec 0c             	sub    $0xc,%esp
      return -1;
80104109:	be ff ff ff ff       	mov    $0xffffffff,%esi
      release(&ptable.lock);
8010410e:	68 20 20 11 80       	push   $0x80112020
80104113:	e8 38 c4 ff ff       	call   80100550 <release>
      return -1;
80104118:	83 c4 10             	add    $0x10,%esp
8010411b:	eb e0                	jmp    801040fd <wait+0xdd>
8010411d:	8d 76 00             	lea    0x0(%esi),%esi

80104120 <wakeup>:
}

// Wake up all processes sleeping on chan.
void
wakeup(void *chan)
{
80104120:	f3 0f 1e fb          	endbr32 
80104124:	55                   	push   %ebp
80104125:	89 e5                	mov    %esp,%ebp
80104127:	53                   	push   %ebx
80104128:	83 ec 10             	sub    $0x10,%esp
8010412b:	8b 5d 08             	mov    0x8(%ebp),%ebx
  acquire(&ptable.lock);
8010412e:	68 20 20 11 80       	push   $0x80112020
80104133:	e8 58 c3 ff ff       	call   80100490 <acquire>
80104138:	83 c4 10             	add    $0x10,%esp
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
8010413b:	b8 54 20 11 80       	mov    $0x80112054,%eax
80104140:	eb 12                	jmp    80104154 <wakeup+0x34>
80104142:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80104148:	05 84 00 00 00       	add    $0x84,%eax
8010414d:	3d 54 41 11 80       	cmp    $0x80114154,%eax
80104152:	74 1e                	je     80104172 <wakeup+0x52>
    if(p->state == SLEEPING && p->chan == chan)
80104154:	83 78 0c 02          	cmpl   $0x2,0xc(%eax)
80104158:	75 ee                	jne    80104148 <wakeup+0x28>
8010415a:	3b 58 20             	cmp    0x20(%eax),%ebx
8010415d:	75 e9                	jne    80104148 <wakeup+0x28>
      p->state = RUNNABLE;
8010415f:	c7 40 0c 03 00 00 00 	movl   $0x3,0xc(%eax)
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80104166:	05 84 00 00 00       	add    $0x84,%eax
8010416b:	3d 54 41 11 80       	cmp    $0x80114154,%eax
80104170:	75 e2                	jne    80104154 <wakeup+0x34>
  wakeup1(chan);
  release(&ptable.lock);
80104172:	c7 45 08 20 20 11 80 	movl   $0x80112020,0x8(%ebp)
}
80104179:	8b 5d fc             	mov    -0x4(%ebp),%ebx
8010417c:	c9                   	leave  
  release(&ptable.lock);
8010417d:	e9 ce c3 ff ff       	jmp    80100550 <release>
80104182:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104189:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80104190 <kill>:
// Kill the process with the given pid.
// Process won't exit until it returns
// to user space (see trap in trap.c).
int
kill(int pid)
{
80104190:	f3 0f 1e fb          	endbr32 
80104194:	55                   	push   %ebp
80104195:	89 e5                	mov    %esp,%ebp
80104197:	53                   	push   %ebx
80104198:	83 ec 10             	sub    $0x10,%esp
8010419b:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct proc *p;

  acquire(&ptable.lock);
8010419e:	68 20 20 11 80       	push   $0x80112020
801041a3:	e8 e8 c2 ff ff       	call   80100490 <acquire>
801041a8:	83 c4 10             	add    $0x10,%esp
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801041ab:	b8 54 20 11 80       	mov    $0x80112054,%eax
801041b0:	eb 12                	jmp    801041c4 <kill+0x34>
801041b2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
801041b8:	05 84 00 00 00       	add    $0x84,%eax
801041bd:	3d 54 41 11 80       	cmp    $0x80114154,%eax
801041c2:	74 34                	je     801041f8 <kill+0x68>
    if(p->pid == pid){
801041c4:	39 58 10             	cmp    %ebx,0x10(%eax)
801041c7:	75 ef                	jne    801041b8 <kill+0x28>
      p->killed = 1;
      // Wake process from sleep if necessary.
      if(p->state == SLEEPING)
801041c9:	83 78 0c 02          	cmpl   $0x2,0xc(%eax)
      p->killed = 1;
801041cd:	c7 40 24 01 00 00 00 	movl   $0x1,0x24(%eax)
      if(p->state == SLEEPING)
801041d4:	75 07                	jne    801041dd <kill+0x4d>
        p->state = RUNNABLE;
801041d6:	c7 40 0c 03 00 00 00 	movl   $0x3,0xc(%eax)
      release(&ptable.lock);
801041dd:	83 ec 0c             	sub    $0xc,%esp
801041e0:	68 20 20 11 80       	push   $0x80112020
801041e5:	e8 66 c3 ff ff       	call   80100550 <release>
      return 0;
    }
  }
  release(&ptable.lock);
  return -1;
}
801041ea:	8b 5d fc             	mov    -0x4(%ebp),%ebx
      return 0;
801041ed:	83 c4 10             	add    $0x10,%esp
801041f0:	31 c0                	xor    %eax,%eax
}
801041f2:	c9                   	leave  
801041f3:	c3                   	ret    
801041f4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  release(&ptable.lock);
801041f8:	83 ec 0c             	sub    $0xc,%esp
801041fb:	68 20 20 11 80       	push   $0x80112020
80104200:	e8 4b c3 ff ff       	call   80100550 <release>
}
80104205:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  return -1;
80104208:	83 c4 10             	add    $0x10,%esp
8010420b:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80104210:	c9                   	leave  
80104211:	c3                   	ret    
80104212:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104219:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80104220 <procdump>:
// Print a process listing to console.  For debugging.
// Runs when user types ^P on console.
// No lock to avoid wedging a stuck machine further.
void
procdump(void)
{
80104220:	f3 0f 1e fb          	endbr32 
80104224:	55                   	push   %ebp
80104225:	89 e5                	mov    %esp,%ebp
80104227:	57                   	push   %edi
80104228:	56                   	push   %esi
80104229:	8d 75 e8             	lea    -0x18(%ebp),%esi
8010422c:	53                   	push   %ebx
8010422d:	bb c0 20 11 80       	mov    $0x801120c0,%ebx
80104232:	83 ec 3c             	sub    $0x3c,%esp
80104235:	eb 2b                	jmp    80104262 <procdump+0x42>
80104237:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010423e:	66 90                	xchg   %ax,%ax
    if(p->state == SLEEPING){
      getcallerpcs((uint*)p->context->ebp+2, pc);
      for(i=0; i<10 && pc[i] != 0; i++)
        cprintf(" %p", pc[i]);
    }
    cprintf("\n");
80104240:	83 ec 0c             	sub    $0xc,%esp
80104243:	68 8d 79 10 80       	push   $0x8010798d
80104248:	e8 93 da ff ff       	call   80101ce0 <cprintf>
8010424d:	83 c4 10             	add    $0x10,%esp
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104250:	81 c3 84 00 00 00    	add    $0x84,%ebx
80104256:	81 fb c0 41 11 80    	cmp    $0x801141c0,%ebx
8010425c:	0f 84 8e 00 00 00    	je     801042f0 <procdump+0xd0>
    if(p->state == UNUSED)
80104262:	8b 43 a0             	mov    -0x60(%ebx),%eax
80104265:	85 c0                	test   %eax,%eax
80104267:	74 e7                	je     80104250 <procdump+0x30>
      state = "???";
80104269:	ba 53 78 10 80       	mov    $0x80107853,%edx
    if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
8010426e:	83 f8 05             	cmp    $0x5,%eax
80104271:	77 11                	ja     80104284 <procdump+0x64>
80104273:	8b 14 85 b4 78 10 80 	mov    -0x7fef874c(,%eax,4),%edx
      state = "???";
8010427a:	b8 53 78 10 80       	mov    $0x80107853,%eax
8010427f:	85 d2                	test   %edx,%edx
80104281:	0f 44 d0             	cmove  %eax,%edx
    cprintf("%d %s %s", p->pid, state, p->name);
80104284:	53                   	push   %ebx
80104285:	52                   	push   %edx
80104286:	ff 73 a4             	pushl  -0x5c(%ebx)
80104289:	68 57 78 10 80       	push   $0x80107857
8010428e:	e8 4d da ff ff       	call   80101ce0 <cprintf>
    if(p->state == SLEEPING){
80104293:	83 c4 10             	add    $0x10,%esp
80104296:	83 7b a0 02          	cmpl   $0x2,-0x60(%ebx)
8010429a:	75 a4                	jne    80104240 <procdump+0x20>
      getcallerpcs((uint*)p->context->ebp+2, pc);
8010429c:	83 ec 08             	sub    $0x8,%esp
8010429f:	8d 45 c0             	lea    -0x40(%ebp),%eax
801042a2:	8d 7d c0             	lea    -0x40(%ebp),%edi
801042a5:	50                   	push   %eax
801042a6:	8b 43 b0             	mov    -0x50(%ebx),%eax
801042a9:	8b 40 0c             	mov    0xc(%eax),%eax
801042ac:	83 c0 08             	add    $0x8,%eax
801042af:	50                   	push   %eax
801042b0:	e8 7b c0 ff ff       	call   80100330 <getcallerpcs>
      for(i=0; i<10 && pc[i] != 0; i++)
801042b5:	83 c4 10             	add    $0x10,%esp
801042b8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801042bf:	90                   	nop
801042c0:	8b 17                	mov    (%edi),%edx
801042c2:	85 d2                	test   %edx,%edx
801042c4:	0f 84 76 ff ff ff    	je     80104240 <procdump+0x20>
        cprintf(" %p", pc[i]);
801042ca:	83 ec 08             	sub    $0x8,%esp
801042cd:	83 c7 04             	add    $0x4,%edi
801042d0:	52                   	push   %edx
801042d1:	68 92 73 10 80       	push   $0x80107392
801042d6:	e8 05 da ff ff       	call   80101ce0 <cprintf>
      for(i=0; i<10 && pc[i] != 0; i++)
801042db:	83 c4 10             	add    $0x10,%esp
801042de:	39 fe                	cmp    %edi,%esi
801042e0:	75 de                	jne    801042c0 <procdump+0xa0>
801042e2:	e9 59 ff ff ff       	jmp    80104240 <procdump+0x20>
801042e7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801042ee:	66 90                	xchg   %ax,%ax
  }
}
801042f0:	8d 65 f4             	lea    -0xc(%ebp),%esp
801042f3:	5b                   	pop    %ebx
801042f4:	5e                   	pop    %esi
801042f5:	5f                   	pop    %edi
801042f6:	5d                   	pop    %ebp
801042f7:	c3                   	ret    
801042f8:	66 90                	xchg   %ax,%ax
801042fa:	66 90                	xchg   %ax,%ax
801042fc:	66 90                	xchg   %ax,%ax
801042fe:	66 90                	xchg   %ax,%ax

80104300 <exec>:
#include "x86.h"
#include "elf.h"

int
exec(char *path, char **argv)
{
80104300:	f3 0f 1e fb          	endbr32 
80104304:	55                   	push   %ebp
80104305:	89 e5                	mov    %esp,%ebp
80104307:	57                   	push   %edi
80104308:	56                   	push   %esi
80104309:	53                   	push   %ebx
8010430a:	81 ec 0c 01 00 00    	sub    $0x10c,%esp
  uint argc, sz, sp, ustack[3+MAXARG+1];
  struct elfhdr elf;
  struct inode *ip;
  struct proghdr ph;
  pde_t *pgdir, *oldpgdir;
  struct proc *curproc = myproc();
80104310:	e8 2b f6 ff ff       	call   80103940 <myproc>
80104315:	89 85 ec fe ff ff    	mov    %eax,-0x114(%ebp)

  begin_op();
8010431b:	e8 80 cb ff ff       	call   80100ea0 <begin_op>

  if((ip = namei(path)) == 0){
80104320:	83 ec 0c             	sub    $0xc,%esp
80104323:	ff 75 08             	pushl  0x8(%ebp)
80104326:	e8 95 ee ff ff       	call   801031c0 <namei>
8010432b:	83 c4 10             	add    $0x10,%esp
8010432e:	85 c0                	test   %eax,%eax
80104330:	0f 84 fe 02 00 00    	je     80104634 <exec+0x334>
    end_op();
    cprintf("exec: fail\n");
    return -1;
  }
  ilock(ip);
80104336:	83 ec 0c             	sub    $0xc,%esp
80104339:	89 c3                	mov    %eax,%ebx
8010433b:	50                   	push   %eax
8010433c:	e8 af e5 ff ff       	call   801028f0 <ilock>
  pgdir = 0;

  // Check ELF header
  if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf))
80104341:	8d 85 24 ff ff ff    	lea    -0xdc(%ebp),%eax
80104347:	6a 34                	push   $0x34
80104349:	6a 00                	push   $0x0
8010434b:	50                   	push   %eax
8010434c:	53                   	push   %ebx
8010434d:	e8 9e e8 ff ff       	call   80102bf0 <readi>
80104352:	83 c4 20             	add    $0x20,%esp
80104355:	83 f8 34             	cmp    $0x34,%eax
80104358:	74 26                	je     80104380 <exec+0x80>

 bad:
  if(pgdir)
    freevm(pgdir);
  if(ip){
    iunlockput(ip);
8010435a:	83 ec 0c             	sub    $0xc,%esp
8010435d:	53                   	push   %ebx
8010435e:	e8 2d e8 ff ff       	call   80102b90 <iunlockput>
    end_op();
80104363:	e8 a8 cb ff ff       	call   80100f10 <end_op>
80104368:	83 c4 10             	add    $0x10,%esp
  }
  return -1;
8010436b:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80104370:	8d 65 f4             	lea    -0xc(%ebp),%esp
80104373:	5b                   	pop    %ebx
80104374:	5e                   	pop    %esi
80104375:	5f                   	pop    %edi
80104376:	5d                   	pop    %ebp
80104377:	c3                   	ret    
80104378:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010437f:	90                   	nop
  if(elf.magic != ELF_MAGIC)
80104380:	81 bd 24 ff ff ff 7f 	cmpl   $0x464c457f,-0xdc(%ebp)
80104387:	45 4c 46 
8010438a:	75 ce                	jne    8010435a <exec+0x5a>
  if((pgdir = setupkvm()) == 0)
8010438c:	e8 7f 09 00 00       	call   80104d10 <setupkvm>
80104391:	89 85 f4 fe ff ff    	mov    %eax,-0x10c(%ebp)
80104397:	85 c0                	test   %eax,%eax
80104399:	74 bf                	je     8010435a <exec+0x5a>
  for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
8010439b:	66 83 bd 50 ff ff ff 	cmpw   $0x0,-0xb0(%ebp)
801043a2:	00 
801043a3:	8b b5 40 ff ff ff    	mov    -0xc0(%ebp),%esi
801043a9:	0f 84 a4 02 00 00    	je     80104653 <exec+0x353>
  sz = 0;
801043af:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
801043b6:	00 00 00 
  for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
801043b9:	31 ff                	xor    %edi,%edi
801043bb:	e9 86 00 00 00       	jmp    80104446 <exec+0x146>
    if(ph.type != ELF_PROG_LOAD)
801043c0:	83 bd 04 ff ff ff 01 	cmpl   $0x1,-0xfc(%ebp)
801043c7:	75 6c                	jne    80104435 <exec+0x135>
    if(ph.memsz < ph.filesz)
801043c9:	8b 85 18 ff ff ff    	mov    -0xe8(%ebp),%eax
801043cf:	3b 85 14 ff ff ff    	cmp    -0xec(%ebp),%eax
801043d5:	0f 82 87 00 00 00    	jb     80104462 <exec+0x162>
    if(ph.vaddr + ph.memsz < ph.vaddr)
801043db:	03 85 0c ff ff ff    	add    -0xf4(%ebp),%eax
801043e1:	72 7f                	jb     80104462 <exec+0x162>
    if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0)
801043e3:	83 ec 04             	sub    $0x4,%esp
801043e6:	50                   	push   %eax
801043e7:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
801043ed:	ff b5 f4 fe ff ff    	pushl  -0x10c(%ebp)
801043f3:	e8 38 07 00 00       	call   80104b30 <allocuvm>
801043f8:	83 c4 10             	add    $0x10,%esp
801043fb:	89 85 f0 fe ff ff    	mov    %eax,-0x110(%ebp)
80104401:	85 c0                	test   %eax,%eax
80104403:	74 5d                	je     80104462 <exec+0x162>
    if(ph.vaddr % PGSIZE != 0)
80104405:	8b 85 0c ff ff ff    	mov    -0xf4(%ebp),%eax
8010440b:	a9 ff 0f 00 00       	test   $0xfff,%eax
80104410:	75 50                	jne    80104462 <exec+0x162>
    if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0)
80104412:	83 ec 0c             	sub    $0xc,%esp
80104415:	ff b5 14 ff ff ff    	pushl  -0xec(%ebp)
8010441b:	ff b5 08 ff ff ff    	pushl  -0xf8(%ebp)
80104421:	53                   	push   %ebx
80104422:	50                   	push   %eax
80104423:	ff b5 f4 fe ff ff    	pushl  -0x10c(%ebp)
80104429:	e8 32 06 00 00       	call   80104a60 <loaduvm>
8010442e:	83 c4 20             	add    $0x20,%esp
80104431:	85 c0                	test   %eax,%eax
80104433:	78 2d                	js     80104462 <exec+0x162>
  for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80104435:	0f b7 85 50 ff ff ff 	movzwl -0xb0(%ebp),%eax
8010443c:	83 c7 01             	add    $0x1,%edi
8010443f:	83 c6 20             	add    $0x20,%esi
80104442:	39 f8                	cmp    %edi,%eax
80104444:	7e 3a                	jle    80104480 <exec+0x180>
    if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph))
80104446:	8d 85 04 ff ff ff    	lea    -0xfc(%ebp),%eax
8010444c:	6a 20                	push   $0x20
8010444e:	56                   	push   %esi
8010444f:	50                   	push   %eax
80104450:	53                   	push   %ebx
80104451:	e8 9a e7 ff ff       	call   80102bf0 <readi>
80104456:	83 c4 10             	add    $0x10,%esp
80104459:	83 f8 20             	cmp    $0x20,%eax
8010445c:	0f 84 5e ff ff ff    	je     801043c0 <exec+0xc0>
    freevm(pgdir);
80104462:	83 ec 0c             	sub    $0xc,%esp
80104465:	ff b5 f4 fe ff ff    	pushl  -0x10c(%ebp)
8010446b:	e8 20 08 00 00       	call   80104c90 <freevm>
  if(ip){
80104470:	83 c4 10             	add    $0x10,%esp
80104473:	e9 e2 fe ff ff       	jmp    8010435a <exec+0x5a>
80104478:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010447f:	90                   	nop
80104480:	8b bd f0 fe ff ff    	mov    -0x110(%ebp),%edi
80104486:	81 c7 ff 0f 00 00    	add    $0xfff,%edi
8010448c:	81 e7 00 f0 ff ff    	and    $0xfffff000,%edi
80104492:	8d b7 00 20 00 00    	lea    0x2000(%edi),%esi
  iunlockput(ip);
80104498:	83 ec 0c             	sub    $0xc,%esp
8010449b:	53                   	push   %ebx
8010449c:	e8 ef e6 ff ff       	call   80102b90 <iunlockput>
  end_op();
801044a1:	e8 6a ca ff ff       	call   80100f10 <end_op>
  if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0)
801044a6:	83 c4 0c             	add    $0xc,%esp
801044a9:	56                   	push   %esi
801044aa:	57                   	push   %edi
801044ab:	8b bd f4 fe ff ff    	mov    -0x10c(%ebp),%edi
801044b1:	57                   	push   %edi
801044b2:	e8 79 06 00 00       	call   80104b30 <allocuvm>
801044b7:	83 c4 10             	add    $0x10,%esp
801044ba:	89 c6                	mov    %eax,%esi
801044bc:	85 c0                	test   %eax,%eax
801044be:	0f 84 94 00 00 00    	je     80104558 <exec+0x258>
  clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
801044c4:	83 ec 08             	sub    $0x8,%esp
801044c7:	8d 80 00 e0 ff ff    	lea    -0x2000(%eax),%eax
  for(argc = 0; argv[argc]; argc++) {
801044cd:	89 f3                	mov    %esi,%ebx
  clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
801044cf:	50                   	push   %eax
801044d0:	57                   	push   %edi
  for(argc = 0; argv[argc]; argc++) {
801044d1:	31 ff                	xor    %edi,%edi
  clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
801044d3:	e8 d8 08 00 00       	call   80104db0 <clearpteu>
  for(argc = 0; argv[argc]; argc++) {
801044d8:	8b 45 0c             	mov    0xc(%ebp),%eax
801044db:	83 c4 10             	add    $0x10,%esp
801044de:	8d 95 58 ff ff ff    	lea    -0xa8(%ebp),%edx
801044e4:	8b 00                	mov    (%eax),%eax
801044e6:	85 c0                	test   %eax,%eax
801044e8:	0f 84 8b 00 00 00    	je     80104579 <exec+0x279>
801044ee:	89 b5 f0 fe ff ff    	mov    %esi,-0x110(%ebp)
801044f4:	8b b5 f4 fe ff ff    	mov    -0x10c(%ebp),%esi
801044fa:	eb 23                	jmp    8010451f <exec+0x21f>
801044fc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80104500:	8b 45 0c             	mov    0xc(%ebp),%eax
    ustack[3+argc] = sp;
80104503:	89 9c bd 64 ff ff ff 	mov    %ebx,-0x9c(%ebp,%edi,4)
  for(argc = 0; argv[argc]; argc++) {
8010450a:	83 c7 01             	add    $0x1,%edi
    ustack[3+argc] = sp;
8010450d:	8d 95 58 ff ff ff    	lea    -0xa8(%ebp),%edx
  for(argc = 0; argv[argc]; argc++) {
80104513:	8b 04 b8             	mov    (%eax,%edi,4),%eax
80104516:	85 c0                	test   %eax,%eax
80104518:	74 59                	je     80104573 <exec+0x273>
    if(argc >= MAXARG)
8010451a:	83 ff 20             	cmp    $0x20,%edi
8010451d:	74 39                	je     80104558 <exec+0x258>
    sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
8010451f:	83 ec 0c             	sub    $0xc,%esp
80104522:	50                   	push   %eax
80104523:	e8 a8 0e 00 00       	call   801053d0 <strlen>
80104528:	f7 d0                	not    %eax
8010452a:	01 c3                	add    %eax,%ebx
    if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
8010452c:	58                   	pop    %eax
8010452d:	8b 45 0c             	mov    0xc(%ebp),%eax
    sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
80104530:	83 e3 fc             	and    $0xfffffffc,%ebx
    if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
80104533:	ff 34 b8             	pushl  (%eax,%edi,4)
80104536:	e8 95 0e 00 00       	call   801053d0 <strlen>
8010453b:	83 c0 01             	add    $0x1,%eax
8010453e:	50                   	push   %eax
8010453f:	8b 45 0c             	mov    0xc(%ebp),%eax
80104542:	ff 34 b8             	pushl  (%eax,%edi,4)
80104545:	53                   	push   %ebx
80104546:	56                   	push   %esi
80104547:	e8 c4 09 00 00       	call   80104f10 <copyout>
8010454c:	83 c4 20             	add    $0x20,%esp
8010454f:	85 c0                	test   %eax,%eax
80104551:	79 ad                	jns    80104500 <exec+0x200>
80104553:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80104557:	90                   	nop
    freevm(pgdir);
80104558:	83 ec 0c             	sub    $0xc,%esp
8010455b:	ff b5 f4 fe ff ff    	pushl  -0x10c(%ebp)
80104561:	e8 2a 07 00 00       	call   80104c90 <freevm>
80104566:	83 c4 10             	add    $0x10,%esp
  return -1;
80104569:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
8010456e:	e9 fd fd ff ff       	jmp    80104370 <exec+0x70>
80104573:	8b b5 f0 fe ff ff    	mov    -0x110(%ebp),%esi
  ustack[2] = sp - (argc+1)*4;  // argv pointer
80104579:	8d 04 bd 04 00 00 00 	lea    0x4(,%edi,4),%eax
80104580:	89 d9                	mov    %ebx,%ecx
  ustack[3+argc] = 0;
80104582:	c7 84 bd 64 ff ff ff 	movl   $0x0,-0x9c(%ebp,%edi,4)
80104589:	00 00 00 00 
  ustack[2] = sp - (argc+1)*4;  // argv pointer
8010458d:	29 c1                	sub    %eax,%ecx
  sp -= (3+argc+1) * 4;
8010458f:	83 c0 0c             	add    $0xc,%eax
  ustack[1] = argc;
80104592:	89 bd 5c ff ff ff    	mov    %edi,-0xa4(%ebp)
  sp -= (3+argc+1) * 4;
80104598:	29 c3                	sub    %eax,%ebx
  if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
8010459a:	50                   	push   %eax
8010459b:	52                   	push   %edx
8010459c:	53                   	push   %ebx
8010459d:	ff b5 f4 fe ff ff    	pushl  -0x10c(%ebp)
  ustack[0] = 0xffffffff;  // fake return PC
801045a3:	c7 85 58 ff ff ff ff 	movl   $0xffffffff,-0xa8(%ebp)
801045aa:	ff ff ff 
  ustack[2] = sp - (argc+1)*4;  // argv pointer
801045ad:	89 8d 60 ff ff ff    	mov    %ecx,-0xa0(%ebp)
  if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
801045b3:	e8 58 09 00 00       	call   80104f10 <copyout>
801045b8:	83 c4 10             	add    $0x10,%esp
801045bb:	85 c0                	test   %eax,%eax
801045bd:	78 99                	js     80104558 <exec+0x258>
  for(last=s=path; *s; s++)
801045bf:	8b 45 08             	mov    0x8(%ebp),%eax
801045c2:	8b 55 08             	mov    0x8(%ebp),%edx
801045c5:	0f b6 00             	movzbl (%eax),%eax
801045c8:	84 c0                	test   %al,%al
801045ca:	74 13                	je     801045df <exec+0x2df>
801045cc:	89 d1                	mov    %edx,%ecx
801045ce:	66 90                	xchg   %ax,%ax
    if(*s == '/')
801045d0:	83 c1 01             	add    $0x1,%ecx
801045d3:	3c 2f                	cmp    $0x2f,%al
  for(last=s=path; *s; s++)
801045d5:	0f b6 01             	movzbl (%ecx),%eax
    if(*s == '/')
801045d8:	0f 44 d1             	cmove  %ecx,%edx
  for(last=s=path; *s; s++)
801045db:	84 c0                	test   %al,%al
801045dd:	75 f1                	jne    801045d0 <exec+0x2d0>
  safestrcpy(curproc->name, last, sizeof(curproc->name));
801045df:	8b bd ec fe ff ff    	mov    -0x114(%ebp),%edi
801045e5:	83 ec 04             	sub    $0x4,%esp
801045e8:	6a 10                	push   $0x10
801045ea:	89 f8                	mov    %edi,%eax
801045ec:	52                   	push   %edx
801045ed:	83 c0 6c             	add    $0x6c,%eax
801045f0:	50                   	push   %eax
801045f1:	e8 9a 0d 00 00       	call   80105390 <safestrcpy>
  curproc->pgdir = pgdir;
801045f6:	8b 8d f4 fe ff ff    	mov    -0x10c(%ebp),%ecx
  oldpgdir = curproc->pgdir;
801045fc:	89 f8                	mov    %edi,%eax
801045fe:	8b 7f 04             	mov    0x4(%edi),%edi
  curproc->sz = sz;
80104601:	89 30                	mov    %esi,(%eax)
  curproc->pgdir = pgdir;
80104603:	89 48 04             	mov    %ecx,0x4(%eax)
  curproc->tf->eip = elf.entry;  // main
80104606:	89 c1                	mov    %eax,%ecx
80104608:	8b 95 3c ff ff ff    	mov    -0xc4(%ebp),%edx
8010460e:	8b 40 18             	mov    0x18(%eax),%eax
80104611:	89 50 38             	mov    %edx,0x38(%eax)
  curproc->tf->esp = sp;
80104614:	8b 41 18             	mov    0x18(%ecx),%eax
80104617:	89 58 44             	mov    %ebx,0x44(%eax)
  switchuvm(curproc);
8010461a:	89 0c 24             	mov    %ecx,(%esp)
8010461d:	e8 ae 02 00 00       	call   801048d0 <switchuvm>
  freevm(oldpgdir);
80104622:	89 3c 24             	mov    %edi,(%esp)
80104625:	e8 66 06 00 00       	call   80104c90 <freevm>
  return 0;
8010462a:	83 c4 10             	add    $0x10,%esp
8010462d:	31 c0                	xor    %eax,%eax
8010462f:	e9 3c fd ff ff       	jmp    80104370 <exec+0x70>
    end_op();
80104634:	e8 d7 c8 ff ff       	call   80100f10 <end_op>
    cprintf("exec: fail\n");
80104639:	83 ec 0c             	sub    $0xc,%esp
8010463c:	68 cc 78 10 80       	push   $0x801078cc
80104641:	e8 9a d6 ff ff       	call   80101ce0 <cprintf>
    return -1;
80104646:	83 c4 10             	add    $0x10,%esp
80104649:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
8010464e:	e9 1d fd ff ff       	jmp    80104370 <exec+0x70>
  for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80104653:	31 ff                	xor    %edi,%edi
80104655:	be 00 20 00 00       	mov    $0x2000,%esi
8010465a:	e9 39 fe ff ff       	jmp    80104498 <exec+0x198>
8010465f:	90                   	nop

80104660 <walkpgdir>:
// Return the address of the PTE in page table pgdir
// that corresponds to virtual address va.  If alloc!=0,
// create any required page table pages.
static pte_t *
walkpgdir(pde_t *pgdir, const void *va, int alloc)
{
80104660:	55                   	push   %ebp
80104661:	89 e5                	mov    %esp,%ebp
80104663:	57                   	push   %edi
80104664:	56                   	push   %esi
80104665:	89 d6                	mov    %edx,%esi
  pde_t *pde;
  pte_t *pgtab;

  pde = &pgdir[PDX(va)];
80104667:	c1 ea 16             	shr    $0x16,%edx
{
8010466a:	53                   	push   %ebx
  pde = &pgdir[PDX(va)];
8010466b:	8d 3c 90             	lea    (%eax,%edx,4),%edi
{
8010466e:	83 ec 0c             	sub    $0xc,%esp
  if(*pde & PTE_P){
80104671:	8b 1f                	mov    (%edi),%ebx
80104673:	f6 c3 01             	test   $0x1,%bl
80104676:	74 28                	je     801046a0 <walkpgdir+0x40>
    pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
80104678:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
8010467e:	81 c3 00 00 00 80    	add    $0x80000000,%ebx
    // The permissions here are overly generous, but they can
    // be further restricted by the permissions in the page table
    // entries, if necessary.
    *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U;
  }
  return &pgtab[PTX(va)];
80104684:	89 f0                	mov    %esi,%eax
}
80104686:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return &pgtab[PTX(va)];
80104689:	c1 e8 0a             	shr    $0xa,%eax
8010468c:	25 fc 0f 00 00       	and    $0xffc,%eax
80104691:	01 d8                	add    %ebx,%eax
}
80104693:	5b                   	pop    %ebx
80104694:	5e                   	pop    %esi
80104695:	5f                   	pop    %edi
80104696:	5d                   	pop    %ebp
80104697:	c3                   	ret    
80104698:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010469f:	90                   	nop
    if(!alloc || (pgtab = (pte_t*)kalloc()) == 0)
801046a0:	85 c9                	test   %ecx,%ecx
801046a2:	74 2c                	je     801046d0 <walkpgdir+0x70>
801046a4:	e8 b7 0a 00 00       	call   80105160 <kalloc>
801046a9:	89 c3                	mov    %eax,%ebx
801046ab:	85 c0                	test   %eax,%eax
801046ad:	74 21                	je     801046d0 <walkpgdir+0x70>
    memset(pgtab, 0, PGSIZE);
801046af:	83 ec 04             	sub    $0x4,%esp
801046b2:	68 00 10 00 00       	push   $0x1000
801046b7:	6a 00                	push   $0x0
801046b9:	50                   	push   %eax
801046ba:	e8 11 0b 00 00       	call   801051d0 <memset>
    *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U;
801046bf:	8d 83 00 00 00 80    	lea    -0x80000000(%ebx),%eax
801046c5:	83 c4 10             	add    $0x10,%esp
801046c8:	83 c8 07             	or     $0x7,%eax
801046cb:	89 07                	mov    %eax,(%edi)
801046cd:	eb b5                	jmp    80104684 <walkpgdir+0x24>
801046cf:	90                   	nop
}
801046d0:	8d 65 f4             	lea    -0xc(%ebp),%esp
      return 0;
801046d3:	31 c0                	xor    %eax,%eax
}
801046d5:	5b                   	pop    %ebx
801046d6:	5e                   	pop    %esi
801046d7:	5f                   	pop    %edi
801046d8:	5d                   	pop    %ebp
801046d9:	c3                   	ret    
801046da:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801046e0 <mappages>:
// Create PTEs for virtual addresses starting at va that refer to
// physical addresses starting at pa. va and size might not
// be page-aligned.
static int
mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm)
{
801046e0:	55                   	push   %ebp
801046e1:	89 e5                	mov    %esp,%ebp
801046e3:	57                   	push   %edi
801046e4:	89 c7                	mov    %eax,%edi
  char *a, *last;
  pte_t *pte;

  a = (char*)PGROUNDDOWN((uint)va);
  last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
801046e6:	8d 44 0a ff          	lea    -0x1(%edx,%ecx,1),%eax
{
801046ea:	56                   	push   %esi
  last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
801046eb:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  a = (char*)PGROUNDDOWN((uint)va);
801046f0:	89 d6                	mov    %edx,%esi
{
801046f2:	53                   	push   %ebx
  a = (char*)PGROUNDDOWN((uint)va);
801046f3:	81 e6 00 f0 ff ff    	and    $0xfffff000,%esi
{
801046f9:	83 ec 1c             	sub    $0x1c,%esp
  last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
801046fc:	89 45 e0             	mov    %eax,-0x20(%ebp)
801046ff:	8b 45 08             	mov    0x8(%ebp),%eax
80104702:	29 f0                	sub    %esi,%eax
80104704:	89 45 e4             	mov    %eax,-0x1c(%ebp)
80104707:	eb 1f                	jmp    80104728 <mappages+0x48>
80104709:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  for(;;){
    if((pte = walkpgdir(pgdir, a, 1)) == 0)
      return -1;
    if(*pte & PTE_P)
80104710:	f6 00 01             	testb  $0x1,(%eax)
80104713:	75 45                	jne    8010475a <mappages+0x7a>
      panic("remap");
    *pte = pa | perm | PTE_P;
80104715:	0b 5d 0c             	or     0xc(%ebp),%ebx
80104718:	83 cb 01             	or     $0x1,%ebx
8010471b:	89 18                	mov    %ebx,(%eax)
    if(a == last)
8010471d:	3b 75 e0             	cmp    -0x20(%ebp),%esi
80104720:	74 2e                	je     80104750 <mappages+0x70>
      break;
    a += PGSIZE;
80104722:	81 c6 00 10 00 00    	add    $0x1000,%esi
  for(;;){
80104728:	8b 45 e4             	mov    -0x1c(%ebp),%eax
    if((pte = walkpgdir(pgdir, a, 1)) == 0)
8010472b:	b9 01 00 00 00       	mov    $0x1,%ecx
80104730:	89 f2                	mov    %esi,%edx
80104732:	8d 1c 06             	lea    (%esi,%eax,1),%ebx
80104735:	89 f8                	mov    %edi,%eax
80104737:	e8 24 ff ff ff       	call   80104660 <walkpgdir>
8010473c:	85 c0                	test   %eax,%eax
8010473e:	75 d0                	jne    80104710 <mappages+0x30>
    pa += PGSIZE;
  }
  return 0;
}
80104740:	8d 65 f4             	lea    -0xc(%ebp),%esp
      return -1;
80104743:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80104748:	5b                   	pop    %ebx
80104749:	5e                   	pop    %esi
8010474a:	5f                   	pop    %edi
8010474b:	5d                   	pop    %ebp
8010474c:	c3                   	ret    
8010474d:	8d 76 00             	lea    0x0(%esi),%esi
80104750:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return 0;
80104753:	31 c0                	xor    %eax,%eax
}
80104755:	5b                   	pop    %ebx
80104756:	5e                   	pop    %esi
80104757:	5f                   	pop    %edi
80104758:	5d                   	pop    %ebp
80104759:	c3                   	ret    
      panic("remap");
8010475a:	83 ec 0c             	sub    $0xc,%esp
8010475d:	68 d8 78 10 80       	push   $0x801078d8
80104762:	e8 59 d2 ff ff       	call   801019c0 <panic>
80104767:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010476e:	66 90                	xchg   %ax,%ax

80104770 <deallocuvm.part.0>:
// Deallocate user pages to bring the process size from oldsz to
// newsz.  oldsz and newsz need not be page-aligned, nor does newsz
// need to be less than oldsz.  oldsz can be larger than the actual
// process size.  Returns the new process size.
int
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
80104770:	55                   	push   %ebp
80104771:	89 e5                	mov    %esp,%ebp
80104773:	57                   	push   %edi
80104774:	56                   	push   %esi
80104775:	89 c6                	mov    %eax,%esi
80104777:	53                   	push   %ebx
80104778:	89 d3                	mov    %edx,%ebx
  uint a, pa;

  if(newsz >= oldsz)
    return oldsz;

  a = PGROUNDUP(newsz);
8010477a:	8d 91 ff 0f 00 00    	lea    0xfff(%ecx),%edx
80104780:	81 e2 00 f0 ff ff    	and    $0xfffff000,%edx
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
80104786:	83 ec 1c             	sub    $0x1c,%esp
80104789:	89 4d e0             	mov    %ecx,-0x20(%ebp)
  for(; a  < oldsz; a += PGSIZE){
8010478c:	39 da                	cmp    %ebx,%edx
8010478e:	73 5b                	jae    801047eb <deallocuvm.part.0+0x7b>
80104790:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
80104793:	89 d7                	mov    %edx,%edi
80104795:	eb 14                	jmp    801047ab <deallocuvm.part.0+0x3b>
80104797:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010479e:	66 90                	xchg   %ax,%ax
801047a0:	81 c7 00 10 00 00    	add    $0x1000,%edi
801047a6:	39 7d e4             	cmp    %edi,-0x1c(%ebp)
801047a9:	76 40                	jbe    801047eb <deallocuvm.part.0+0x7b>
    pte = walkpgdir(pgdir, (char*)a, 0);
801047ab:	31 c9                	xor    %ecx,%ecx
801047ad:	89 fa                	mov    %edi,%edx
801047af:	89 f0                	mov    %esi,%eax
801047b1:	e8 aa fe ff ff       	call   80104660 <walkpgdir>
801047b6:	89 c3                	mov    %eax,%ebx
    if(!pte)
801047b8:	85 c0                	test   %eax,%eax
801047ba:	74 44                	je     80104800 <deallocuvm.part.0+0x90>
      a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE;
    else if((*pte & PTE_P) != 0){
801047bc:	8b 00                	mov    (%eax),%eax
801047be:	a8 01                	test   $0x1,%al
801047c0:	74 de                	je     801047a0 <deallocuvm.part.0+0x30>
      pa = PTE_ADDR(*pte);
      if(pa == 0)
801047c2:	25 00 f0 ff ff       	and    $0xfffff000,%eax
801047c7:	74 47                	je     80104810 <deallocuvm.part.0+0xa0>
        panic("kfree");
      char *v = P2V(pa);
      kfree(v);
801047c9:	83 ec 0c             	sub    $0xc,%esp
      char *v = P2V(pa);
801047cc:	05 00 00 00 80       	add    $0x80000000,%eax
801047d1:	81 c7 00 10 00 00    	add    $0x1000,%edi
      kfree(v);
801047d7:	50                   	push   %eax
801047d8:	e8 c3 07 00 00       	call   80104fa0 <kfree>
      *pte = 0;
801047dd:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
801047e3:	83 c4 10             	add    $0x10,%esp
  for(; a  < oldsz; a += PGSIZE){
801047e6:	39 7d e4             	cmp    %edi,-0x1c(%ebp)
801047e9:	77 c0                	ja     801047ab <deallocuvm.part.0+0x3b>
    }
  }
  return newsz;
}
801047eb:	8b 45 e0             	mov    -0x20(%ebp),%eax
801047ee:	8d 65 f4             	lea    -0xc(%ebp),%esp
801047f1:	5b                   	pop    %ebx
801047f2:	5e                   	pop    %esi
801047f3:	5f                   	pop    %edi
801047f4:	5d                   	pop    %ebp
801047f5:	c3                   	ret    
801047f6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801047fd:	8d 76 00             	lea    0x0(%esi),%esi
      a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE;
80104800:	89 fa                	mov    %edi,%edx
80104802:	81 e2 00 00 c0 ff    	and    $0xffc00000,%edx
80104808:	8d ba 00 00 40 00    	lea    0x400000(%edx),%edi
8010480e:	eb 96                	jmp    801047a6 <deallocuvm.part.0+0x36>
        panic("kfree");
80104810:	83 ec 0c             	sub    $0xc,%esp
80104813:	68 de 78 10 80       	push   $0x801078de
80104818:	e8 a3 d1 ff ff       	call   801019c0 <panic>
8010481d:	8d 76 00             	lea    0x0(%esi),%esi

80104820 <seginit>:
{
80104820:	f3 0f 1e fb          	endbr32 
80104824:	55                   	push   %ebp
80104825:	89 e5                	mov    %esp,%ebp
80104827:	83 ec 18             	sub    $0x18,%esp
  c = &cpus[cpuid()];
8010482a:	e8 f1 f0 ff ff       	call   80103920 <cpuid>
  pd[0] = size-1;
8010482f:	ba 2f 00 00 00       	mov    $0x2f,%edx
80104834:	69 c0 b0 00 00 00    	imul   $0xb0,%eax,%eax
8010483a:	66 89 55 f2          	mov    %dx,-0xe(%ebp)
  c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
8010483e:	c7 80 98 a9 10 80 ff 	movl   $0xffff,-0x7fef5668(%eax)
80104845:	ff 00 00 
80104848:	c7 80 9c a9 10 80 00 	movl   $0xcf9a00,-0x7fef5664(%eax)
8010484f:	9a cf 00 
  c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
80104852:	c7 80 a0 a9 10 80 ff 	movl   $0xffff,-0x7fef5660(%eax)
80104859:	ff 00 00 
8010485c:	c7 80 a4 a9 10 80 00 	movl   $0xcf9200,-0x7fef565c(%eax)
80104863:	92 cf 00 
  c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
80104866:	c7 80 a8 a9 10 80 ff 	movl   $0xffff,-0x7fef5658(%eax)
8010486d:	ff 00 00 
80104870:	c7 80 ac a9 10 80 00 	movl   $0xcffa00,-0x7fef5654(%eax)
80104877:	fa cf 00 
  c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
8010487a:	c7 80 b0 a9 10 80 ff 	movl   $0xffff,-0x7fef5650(%eax)
80104881:	ff 00 00 
80104884:	c7 80 b4 a9 10 80 00 	movl   $0xcff200,-0x7fef564c(%eax)
8010488b:	f2 cf 00 
  lgdt(c->gdt, sizeof(c->gdt));
8010488e:	05 90 a9 10 80       	add    $0x8010a990,%eax
  pd[1] = (uint)p;
80104893:	66 89 45 f4          	mov    %ax,-0xc(%ebp)
  pd[2] = (uint)p >> 16;
80104897:	c1 e8 10             	shr    $0x10,%eax
8010489a:	66 89 45 f6          	mov    %ax,-0xa(%ebp)
  asm volatile("lgdt (%0)" : : "r" (pd));
8010489e:	8d 45 f2             	lea    -0xe(%ebp),%eax
801048a1:	0f 01 10             	lgdtl  (%eax)
}
801048a4:	c9                   	leave  
801048a5:	c3                   	ret    
801048a6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801048ad:	8d 76 00             	lea    0x0(%esi),%esi

801048b0 <switchkvm>:
{
801048b0:	f3 0f 1e fb          	endbr32 
  lcr3(V2P(kpgdir));   // switch to the kernel page table
801048b4:	a1 54 41 11 80       	mov    0x80114154,%eax
801048b9:	05 00 00 00 80       	add    $0x80000000,%eax
}

static inline void
lcr3(uint val)
{
  asm volatile("movl %0,%%cr3" : : "r" (val));
801048be:	0f 22 d8             	mov    %eax,%cr3
}
801048c1:	c3                   	ret    
801048c2:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801048c9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

801048d0 <switchuvm>:
{
801048d0:	f3 0f 1e fb          	endbr32 
801048d4:	55                   	push   %ebp
801048d5:	89 e5                	mov    %esp,%ebp
801048d7:	57                   	push   %edi
801048d8:	56                   	push   %esi
801048d9:	53                   	push   %ebx
801048da:	83 ec 1c             	sub    $0x1c,%esp
801048dd:	8b 75 08             	mov    0x8(%ebp),%esi
  if(p == 0)
801048e0:	85 f6                	test   %esi,%esi
801048e2:	0f 84 cb 00 00 00    	je     801049b3 <switchuvm+0xe3>
  if(p->kstack == 0)
801048e8:	8b 46 08             	mov    0x8(%esi),%eax
801048eb:	85 c0                	test   %eax,%eax
801048ed:	0f 84 da 00 00 00    	je     801049cd <switchuvm+0xfd>
  if(p->pgdir == 0)
801048f3:	8b 46 04             	mov    0x4(%esi),%eax
801048f6:	85 c0                	test   %eax,%eax
801048f8:	0f 84 c2 00 00 00    	je     801049c0 <switchuvm+0xf0>
  pushcli();
801048fe:	e8 8d ba ff ff       	call   80100390 <pushcli>
  mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts,
80104903:	e8 a8 ef ff ff       	call   801038b0 <mycpu>
80104908:	89 c3                	mov    %eax,%ebx
8010490a:	e8 a1 ef ff ff       	call   801038b0 <mycpu>
8010490f:	89 c7                	mov    %eax,%edi
80104911:	e8 9a ef ff ff       	call   801038b0 <mycpu>
80104916:	83 c7 08             	add    $0x8,%edi
80104919:	89 45 e4             	mov    %eax,-0x1c(%ebp)
8010491c:	e8 8f ef ff ff       	call   801038b0 <mycpu>
80104921:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
80104924:	ba 67 00 00 00       	mov    $0x67,%edx
80104929:	66 89 bb 9a 00 00 00 	mov    %di,0x9a(%ebx)
80104930:	83 c0 08             	add    $0x8,%eax
80104933:	66 89 93 98 00 00 00 	mov    %dx,0x98(%ebx)
  mycpu()->ts.iomb = (ushort) 0xFFFF;
8010493a:	bf ff ff ff ff       	mov    $0xffffffff,%edi
  mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts,
8010493f:	83 c1 08             	add    $0x8,%ecx
80104942:	c1 e8 18             	shr    $0x18,%eax
80104945:	c1 e9 10             	shr    $0x10,%ecx
80104948:	88 83 9f 00 00 00    	mov    %al,0x9f(%ebx)
8010494e:	88 8b 9c 00 00 00    	mov    %cl,0x9c(%ebx)
80104954:	b9 99 40 00 00       	mov    $0x4099,%ecx
80104959:	66 89 8b 9d 00 00 00 	mov    %cx,0x9d(%ebx)
  mycpu()->ts.ss0 = SEG_KDATA << 3;
80104960:	bb 10 00 00 00       	mov    $0x10,%ebx
  mycpu()->gdt[SEG_TSS].s = 0;
80104965:	e8 46 ef ff ff       	call   801038b0 <mycpu>
8010496a:	80 a0 9d 00 00 00 ef 	andb   $0xef,0x9d(%eax)
  mycpu()->ts.ss0 = SEG_KDATA << 3;
80104971:	e8 3a ef ff ff       	call   801038b0 <mycpu>
80104976:	66 89 58 10          	mov    %bx,0x10(%eax)
  mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE;
8010497a:	8b 5e 08             	mov    0x8(%esi),%ebx
8010497d:	81 c3 00 10 00 00    	add    $0x1000,%ebx
80104983:	e8 28 ef ff ff       	call   801038b0 <mycpu>
80104988:	89 58 0c             	mov    %ebx,0xc(%eax)
  mycpu()->ts.iomb = (ushort) 0xFFFF;
8010498b:	e8 20 ef ff ff       	call   801038b0 <mycpu>
80104990:	66 89 78 6e          	mov    %di,0x6e(%eax)
  asm volatile("ltr %0" : : "r" (sel));
80104994:	b8 28 00 00 00       	mov    $0x28,%eax
80104999:	0f 00 d8             	ltr    %ax
  lcr3(V2P(p->pgdir));  // switch to process's address space
8010499c:	8b 46 04             	mov    0x4(%esi),%eax
8010499f:	05 00 00 00 80       	add    $0x80000000,%eax
  asm volatile("movl %0,%%cr3" : : "r" (val));
801049a4:	0f 22 d8             	mov    %eax,%cr3
}
801049a7:	8d 65 f4             	lea    -0xc(%ebp),%esp
801049aa:	5b                   	pop    %ebx
801049ab:	5e                   	pop    %esi
801049ac:	5f                   	pop    %edi
801049ad:	5d                   	pop    %ebp
  popcli();
801049ae:	e9 2d ba ff ff       	jmp    801003e0 <popcli>
    panic("switchuvm: no process");
801049b3:	83 ec 0c             	sub    $0xc,%esp
801049b6:	68 e4 78 10 80       	push   $0x801078e4
801049bb:	e8 00 d0 ff ff       	call   801019c0 <panic>
    panic("switchuvm: no pgdir");
801049c0:	83 ec 0c             	sub    $0xc,%esp
801049c3:	68 0f 79 10 80       	push   $0x8010790f
801049c8:	e8 f3 cf ff ff       	call   801019c0 <panic>
    panic("switchuvm: no kstack");
801049cd:	83 ec 0c             	sub    $0xc,%esp
801049d0:	68 fa 78 10 80       	push   $0x801078fa
801049d5:	e8 e6 cf ff ff       	call   801019c0 <panic>
801049da:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801049e0 <inituvm>:
{
801049e0:	f3 0f 1e fb          	endbr32 
801049e4:	55                   	push   %ebp
801049e5:	89 e5                	mov    %esp,%ebp
801049e7:	57                   	push   %edi
801049e8:	56                   	push   %esi
801049e9:	53                   	push   %ebx
801049ea:	83 ec 1c             	sub    $0x1c,%esp
801049ed:	8b 45 0c             	mov    0xc(%ebp),%eax
801049f0:	8b 75 10             	mov    0x10(%ebp),%esi
801049f3:	8b 7d 08             	mov    0x8(%ebp),%edi
801049f6:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  if(sz >= PGSIZE)
801049f9:	81 fe ff 0f 00 00    	cmp    $0xfff,%esi
801049ff:	77 4b                	ja     80104a4c <inituvm+0x6c>
  mem = kalloc();
80104a01:	e8 5a 07 00 00       	call   80105160 <kalloc>
  memset(mem, 0, PGSIZE);
80104a06:	83 ec 04             	sub    $0x4,%esp
80104a09:	68 00 10 00 00       	push   $0x1000
  mem = kalloc();
80104a0e:	89 c3                	mov    %eax,%ebx
  memset(mem, 0, PGSIZE);
80104a10:	6a 00                	push   $0x0
80104a12:	50                   	push   %eax
80104a13:	e8 b8 07 00 00       	call   801051d0 <memset>
  mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U);
80104a18:	58                   	pop    %eax
80104a19:	8d 83 00 00 00 80    	lea    -0x80000000(%ebx),%eax
80104a1f:	5a                   	pop    %edx
80104a20:	6a 06                	push   $0x6
80104a22:	b9 00 10 00 00       	mov    $0x1000,%ecx
80104a27:	31 d2                	xor    %edx,%edx
80104a29:	50                   	push   %eax
80104a2a:	89 f8                	mov    %edi,%eax
80104a2c:	e8 af fc ff ff       	call   801046e0 <mappages>
  memmove(mem, init, sz);
80104a31:	8b 45 e4             	mov    -0x1c(%ebp),%eax
80104a34:	89 75 10             	mov    %esi,0x10(%ebp)
80104a37:	83 c4 10             	add    $0x10,%esp
80104a3a:	89 5d 08             	mov    %ebx,0x8(%ebp)
80104a3d:	89 45 0c             	mov    %eax,0xc(%ebp)
}
80104a40:	8d 65 f4             	lea    -0xc(%ebp),%esp
80104a43:	5b                   	pop    %ebx
80104a44:	5e                   	pop    %esi
80104a45:	5f                   	pop    %edi
80104a46:	5d                   	pop    %ebp
  memmove(mem, init, sz);
80104a47:	e9 24 08 00 00       	jmp    80105270 <memmove>
    panic("inituvm: more than a page");
80104a4c:	83 ec 0c             	sub    $0xc,%esp
80104a4f:	68 23 79 10 80       	push   $0x80107923
80104a54:	e8 67 cf ff ff       	call   801019c0 <panic>
80104a59:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80104a60 <loaduvm>:
{
80104a60:	f3 0f 1e fb          	endbr32 
80104a64:	55                   	push   %ebp
80104a65:	89 e5                	mov    %esp,%ebp
80104a67:	57                   	push   %edi
80104a68:	56                   	push   %esi
80104a69:	53                   	push   %ebx
80104a6a:	83 ec 1c             	sub    $0x1c,%esp
80104a6d:	8b 45 0c             	mov    0xc(%ebp),%eax
80104a70:	8b 75 18             	mov    0x18(%ebp),%esi
  if((uint) addr % PGSIZE != 0)
80104a73:	a9 ff 0f 00 00       	test   $0xfff,%eax
80104a78:	0f 85 99 00 00 00    	jne    80104b17 <loaduvm+0xb7>
  for(i = 0; i < sz; i += PGSIZE){
80104a7e:	01 f0                	add    %esi,%eax
80104a80:	89 f3                	mov    %esi,%ebx
80104a82:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    if(readi(ip, P2V(pa), offset+i, n) != n)
80104a85:	8b 45 14             	mov    0x14(%ebp),%eax
80104a88:	01 f0                	add    %esi,%eax
80104a8a:	89 45 e0             	mov    %eax,-0x20(%ebp)
  for(i = 0; i < sz; i += PGSIZE){
80104a8d:	85 f6                	test   %esi,%esi
80104a8f:	75 15                	jne    80104aa6 <loaduvm+0x46>
80104a91:	eb 6d                	jmp    80104b00 <loaduvm+0xa0>
80104a93:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80104a97:	90                   	nop
80104a98:	81 eb 00 10 00 00    	sub    $0x1000,%ebx
80104a9e:	89 f0                	mov    %esi,%eax
80104aa0:	29 d8                	sub    %ebx,%eax
80104aa2:	39 c6                	cmp    %eax,%esi
80104aa4:	76 5a                	jbe    80104b00 <loaduvm+0xa0>
    if((pte = walkpgdir(pgdir, addr+i, 0)) == 0)
80104aa6:	8b 55 e4             	mov    -0x1c(%ebp),%edx
80104aa9:	8b 45 08             	mov    0x8(%ebp),%eax
80104aac:	31 c9                	xor    %ecx,%ecx
80104aae:	29 da                	sub    %ebx,%edx
80104ab0:	e8 ab fb ff ff       	call   80104660 <walkpgdir>
80104ab5:	85 c0                	test   %eax,%eax
80104ab7:	74 51                	je     80104b0a <loaduvm+0xaa>
    pa = PTE_ADDR(*pte);
80104ab9:	8b 00                	mov    (%eax),%eax
    if(readi(ip, P2V(pa), offset+i, n) != n)
80104abb:	8b 4d e0             	mov    -0x20(%ebp),%ecx
    if(sz - i < PGSIZE)
80104abe:	bf 00 10 00 00       	mov    $0x1000,%edi
    pa = PTE_ADDR(*pte);
80104ac3:	25 00 f0 ff ff       	and    $0xfffff000,%eax
    if(sz - i < PGSIZE)
80104ac8:	81 fb ff 0f 00 00    	cmp    $0xfff,%ebx
80104ace:	0f 46 fb             	cmovbe %ebx,%edi
    if(readi(ip, P2V(pa), offset+i, n) != n)
80104ad1:	29 d9                	sub    %ebx,%ecx
80104ad3:	05 00 00 00 80       	add    $0x80000000,%eax
80104ad8:	57                   	push   %edi
80104ad9:	51                   	push   %ecx
80104ada:	50                   	push   %eax
80104adb:	ff 75 10             	pushl  0x10(%ebp)
80104ade:	e8 0d e1 ff ff       	call   80102bf0 <readi>
80104ae3:	83 c4 10             	add    $0x10,%esp
80104ae6:	39 f8                	cmp    %edi,%eax
80104ae8:	74 ae                	je     80104a98 <loaduvm+0x38>
}
80104aea:	8d 65 f4             	lea    -0xc(%ebp),%esp
      return -1;
80104aed:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80104af2:	5b                   	pop    %ebx
80104af3:	5e                   	pop    %esi
80104af4:	5f                   	pop    %edi
80104af5:	5d                   	pop    %ebp
80104af6:	c3                   	ret    
80104af7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104afe:	66 90                	xchg   %ax,%ax
80104b00:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return 0;
80104b03:	31 c0                	xor    %eax,%eax
}
80104b05:	5b                   	pop    %ebx
80104b06:	5e                   	pop    %esi
80104b07:	5f                   	pop    %edi
80104b08:	5d                   	pop    %ebp
80104b09:	c3                   	ret    
      panic("loaduvm: address should exist");
80104b0a:	83 ec 0c             	sub    $0xc,%esp
80104b0d:	68 3d 79 10 80       	push   $0x8010793d
80104b12:	e8 a9 ce ff ff       	call   801019c0 <panic>
    panic("loaduvm: addr must be page aligned");
80104b17:	83 ec 0c             	sub    $0xc,%esp
80104b1a:	68 e0 79 10 80       	push   $0x801079e0
80104b1f:	e8 9c ce ff ff       	call   801019c0 <panic>
80104b24:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104b2b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80104b2f:	90                   	nop

80104b30 <allocuvm>:
{
80104b30:	f3 0f 1e fb          	endbr32 
80104b34:	55                   	push   %ebp
80104b35:	89 e5                	mov    %esp,%ebp
80104b37:	57                   	push   %edi
80104b38:	56                   	push   %esi
80104b39:	53                   	push   %ebx
80104b3a:	83 ec 1c             	sub    $0x1c,%esp
  if(newsz >= KERNBASE)
80104b3d:	8b 45 10             	mov    0x10(%ebp),%eax
{
80104b40:	8b 7d 08             	mov    0x8(%ebp),%edi
  if(newsz >= KERNBASE)
80104b43:	89 45 e4             	mov    %eax,-0x1c(%ebp)
80104b46:	85 c0                	test   %eax,%eax
80104b48:	0f 88 b2 00 00 00    	js     80104c00 <allocuvm+0xd0>
  if(newsz < oldsz)
80104b4e:	3b 45 0c             	cmp    0xc(%ebp),%eax
    return oldsz;
80104b51:	8b 45 0c             	mov    0xc(%ebp),%eax
  if(newsz < oldsz)
80104b54:	0f 82 96 00 00 00    	jb     80104bf0 <allocuvm+0xc0>
  a = PGROUNDUP(oldsz);
80104b5a:	8d b0 ff 0f 00 00    	lea    0xfff(%eax),%esi
80104b60:	81 e6 00 f0 ff ff    	and    $0xfffff000,%esi
  for(; a < newsz; a += PGSIZE){
80104b66:	39 75 10             	cmp    %esi,0x10(%ebp)
80104b69:	77 40                	ja     80104bab <allocuvm+0x7b>
80104b6b:	e9 83 00 00 00       	jmp    80104bf3 <allocuvm+0xc3>
    memset(mem, 0, PGSIZE);
80104b70:	83 ec 04             	sub    $0x4,%esp
80104b73:	68 00 10 00 00       	push   $0x1000
80104b78:	6a 00                	push   $0x0
80104b7a:	50                   	push   %eax
80104b7b:	e8 50 06 00 00       	call   801051d0 <memset>
    if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){
80104b80:	58                   	pop    %eax
80104b81:	8d 83 00 00 00 80    	lea    -0x80000000(%ebx),%eax
80104b87:	5a                   	pop    %edx
80104b88:	6a 06                	push   $0x6
80104b8a:	b9 00 10 00 00       	mov    $0x1000,%ecx
80104b8f:	89 f2                	mov    %esi,%edx
80104b91:	50                   	push   %eax
80104b92:	89 f8                	mov    %edi,%eax
80104b94:	e8 47 fb ff ff       	call   801046e0 <mappages>
80104b99:	83 c4 10             	add    $0x10,%esp
80104b9c:	85 c0                	test   %eax,%eax
80104b9e:	78 78                	js     80104c18 <allocuvm+0xe8>
  for(; a < newsz; a += PGSIZE){
80104ba0:	81 c6 00 10 00 00    	add    $0x1000,%esi
80104ba6:	39 75 10             	cmp    %esi,0x10(%ebp)
80104ba9:	76 48                	jbe    80104bf3 <allocuvm+0xc3>
    mem = kalloc();
80104bab:	e8 b0 05 00 00       	call   80105160 <kalloc>
80104bb0:	89 c3                	mov    %eax,%ebx
    if(mem == 0){
80104bb2:	85 c0                	test   %eax,%eax
80104bb4:	75 ba                	jne    80104b70 <allocuvm+0x40>
      cprintf("allocuvm out of memory\n");
80104bb6:	83 ec 0c             	sub    $0xc,%esp
80104bb9:	68 5b 79 10 80       	push   $0x8010795b
80104bbe:	e8 1d d1 ff ff       	call   80101ce0 <cprintf>
  if(newsz >= oldsz)
80104bc3:	8b 45 0c             	mov    0xc(%ebp),%eax
80104bc6:	83 c4 10             	add    $0x10,%esp
80104bc9:	39 45 10             	cmp    %eax,0x10(%ebp)
80104bcc:	74 32                	je     80104c00 <allocuvm+0xd0>
80104bce:	8b 55 10             	mov    0x10(%ebp),%edx
80104bd1:	89 c1                	mov    %eax,%ecx
80104bd3:	89 f8                	mov    %edi,%eax
80104bd5:	e8 96 fb ff ff       	call   80104770 <deallocuvm.part.0>
      return 0;
80104bda:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
}
80104be1:	8b 45 e4             	mov    -0x1c(%ebp),%eax
80104be4:	8d 65 f4             	lea    -0xc(%ebp),%esp
80104be7:	5b                   	pop    %ebx
80104be8:	5e                   	pop    %esi
80104be9:	5f                   	pop    %edi
80104bea:	5d                   	pop    %ebp
80104beb:	c3                   	ret    
80104bec:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    return oldsz;
80104bf0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
}
80104bf3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
80104bf6:	8d 65 f4             	lea    -0xc(%ebp),%esp
80104bf9:	5b                   	pop    %ebx
80104bfa:	5e                   	pop    %esi
80104bfb:	5f                   	pop    %edi
80104bfc:	5d                   	pop    %ebp
80104bfd:	c3                   	ret    
80104bfe:	66 90                	xchg   %ax,%ax
    return 0;
80104c00:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
}
80104c07:	8b 45 e4             	mov    -0x1c(%ebp),%eax
80104c0a:	8d 65 f4             	lea    -0xc(%ebp),%esp
80104c0d:	5b                   	pop    %ebx
80104c0e:	5e                   	pop    %esi
80104c0f:	5f                   	pop    %edi
80104c10:	5d                   	pop    %ebp
80104c11:	c3                   	ret    
80104c12:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
      cprintf("allocuvm out of memory (2)\n");
80104c18:	83 ec 0c             	sub    $0xc,%esp
80104c1b:	68 73 79 10 80       	push   $0x80107973
80104c20:	e8 bb d0 ff ff       	call   80101ce0 <cprintf>
  if(newsz >= oldsz)
80104c25:	8b 45 0c             	mov    0xc(%ebp),%eax
80104c28:	83 c4 10             	add    $0x10,%esp
80104c2b:	39 45 10             	cmp    %eax,0x10(%ebp)
80104c2e:	74 0c                	je     80104c3c <allocuvm+0x10c>
80104c30:	8b 55 10             	mov    0x10(%ebp),%edx
80104c33:	89 c1                	mov    %eax,%ecx
80104c35:	89 f8                	mov    %edi,%eax
80104c37:	e8 34 fb ff ff       	call   80104770 <deallocuvm.part.0>
      kfree(mem);
80104c3c:	83 ec 0c             	sub    $0xc,%esp
80104c3f:	53                   	push   %ebx
80104c40:	e8 5b 03 00 00       	call   80104fa0 <kfree>
      return 0;
80104c45:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
80104c4c:	83 c4 10             	add    $0x10,%esp
}
80104c4f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
80104c52:	8d 65 f4             	lea    -0xc(%ebp),%esp
80104c55:	5b                   	pop    %ebx
80104c56:	5e                   	pop    %esi
80104c57:	5f                   	pop    %edi
80104c58:	5d                   	pop    %ebp
80104c59:	c3                   	ret    
80104c5a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80104c60 <deallocuvm>:
{
80104c60:	f3 0f 1e fb          	endbr32 
80104c64:	55                   	push   %ebp
80104c65:	89 e5                	mov    %esp,%ebp
80104c67:	8b 55 0c             	mov    0xc(%ebp),%edx
80104c6a:	8b 4d 10             	mov    0x10(%ebp),%ecx
80104c6d:	8b 45 08             	mov    0x8(%ebp),%eax
  if(newsz >= oldsz)
80104c70:	39 d1                	cmp    %edx,%ecx
80104c72:	73 0c                	jae    80104c80 <deallocuvm+0x20>
}
80104c74:	5d                   	pop    %ebp
80104c75:	e9 f6 fa ff ff       	jmp    80104770 <deallocuvm.part.0>
80104c7a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80104c80:	89 d0                	mov    %edx,%eax
80104c82:	5d                   	pop    %ebp
80104c83:	c3                   	ret    
80104c84:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104c8b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80104c8f:	90                   	nop

80104c90 <freevm>:

// Free a page table and all the physical memory pages
// in the user part.
void
freevm(pde_t *pgdir)
{
80104c90:	f3 0f 1e fb          	endbr32 
80104c94:	55                   	push   %ebp
80104c95:	89 e5                	mov    %esp,%ebp
80104c97:	57                   	push   %edi
80104c98:	56                   	push   %esi
80104c99:	53                   	push   %ebx
80104c9a:	83 ec 0c             	sub    $0xc,%esp
80104c9d:	8b 75 08             	mov    0x8(%ebp),%esi
  uint i;

  if(pgdir == 0)
80104ca0:	85 f6                	test   %esi,%esi
80104ca2:	74 55                	je     80104cf9 <freevm+0x69>
  if(newsz >= oldsz)
80104ca4:	31 c9                	xor    %ecx,%ecx
80104ca6:	ba 00 00 00 80       	mov    $0x80000000,%edx
80104cab:	89 f0                	mov    %esi,%eax
80104cad:	89 f3                	mov    %esi,%ebx
80104caf:	e8 bc fa ff ff       	call   80104770 <deallocuvm.part.0>
    panic("freevm: no pgdir");
  deallocuvm(pgdir, KERNBASE, 0);
  for(i = 0; i < NPDENTRIES; i++){
80104cb4:	8d be 00 10 00 00    	lea    0x1000(%esi),%edi
80104cba:	eb 0b                	jmp    80104cc7 <freevm+0x37>
80104cbc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80104cc0:	83 c3 04             	add    $0x4,%ebx
80104cc3:	39 df                	cmp    %ebx,%edi
80104cc5:	74 23                	je     80104cea <freevm+0x5a>
    if(pgdir[i] & PTE_P){
80104cc7:	8b 03                	mov    (%ebx),%eax
80104cc9:	a8 01                	test   $0x1,%al
80104ccb:	74 f3                	je     80104cc0 <freevm+0x30>
      char * v = P2V(PTE_ADDR(pgdir[i]));
80104ccd:	25 00 f0 ff ff       	and    $0xfffff000,%eax
      kfree(v);
80104cd2:	83 ec 0c             	sub    $0xc,%esp
80104cd5:	83 c3 04             	add    $0x4,%ebx
      char * v = P2V(PTE_ADDR(pgdir[i]));
80104cd8:	05 00 00 00 80       	add    $0x80000000,%eax
      kfree(v);
80104cdd:	50                   	push   %eax
80104cde:	e8 bd 02 00 00       	call   80104fa0 <kfree>
80104ce3:	83 c4 10             	add    $0x10,%esp
  for(i = 0; i < NPDENTRIES; i++){
80104ce6:	39 df                	cmp    %ebx,%edi
80104ce8:	75 dd                	jne    80104cc7 <freevm+0x37>
    }
  }
  kfree((char*)pgdir);
80104cea:	89 75 08             	mov    %esi,0x8(%ebp)
}
80104ced:	8d 65 f4             	lea    -0xc(%ebp),%esp
80104cf0:	5b                   	pop    %ebx
80104cf1:	5e                   	pop    %esi
80104cf2:	5f                   	pop    %edi
80104cf3:	5d                   	pop    %ebp
  kfree((char*)pgdir);
80104cf4:	e9 a7 02 00 00       	jmp    80104fa0 <kfree>
    panic("freevm: no pgdir");
80104cf9:	83 ec 0c             	sub    $0xc,%esp
80104cfc:	68 8f 79 10 80       	push   $0x8010798f
80104d01:	e8 ba cc ff ff       	call   801019c0 <panic>
80104d06:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104d0d:	8d 76 00             	lea    0x0(%esi),%esi

80104d10 <setupkvm>:
{
80104d10:	f3 0f 1e fb          	endbr32 
80104d14:	55                   	push   %ebp
80104d15:	89 e5                	mov    %esp,%ebp
80104d17:	56                   	push   %esi
80104d18:	53                   	push   %ebx
  if((pgdir = (pde_t*)kalloc()) == 0)
80104d19:	e8 42 04 00 00       	call   80105160 <kalloc>
80104d1e:	89 c6                	mov    %eax,%esi
80104d20:	85 c0                	test   %eax,%eax
80104d22:	74 42                	je     80104d66 <setupkvm+0x56>
  memset(pgdir, 0, PGSIZE);
80104d24:	83 ec 04             	sub    $0x4,%esp
  for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
80104d27:	bb 20 93 10 80       	mov    $0x80109320,%ebx
  memset(pgdir, 0, PGSIZE);
80104d2c:	68 00 10 00 00       	push   $0x1000
80104d31:	6a 00                	push   $0x0
80104d33:	50                   	push   %eax
80104d34:	e8 97 04 00 00       	call   801051d0 <memset>
80104d39:	83 c4 10             	add    $0x10,%esp
                (uint)k->phys_start, k->perm) < 0) {
80104d3c:	8b 43 04             	mov    0x4(%ebx),%eax
    if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
80104d3f:	83 ec 08             	sub    $0x8,%esp
80104d42:	8b 4b 08             	mov    0x8(%ebx),%ecx
80104d45:	ff 73 0c             	pushl  0xc(%ebx)
80104d48:	8b 13                	mov    (%ebx),%edx
80104d4a:	50                   	push   %eax
80104d4b:	29 c1                	sub    %eax,%ecx
80104d4d:	89 f0                	mov    %esi,%eax
80104d4f:	e8 8c f9 ff ff       	call   801046e0 <mappages>
80104d54:	83 c4 10             	add    $0x10,%esp
80104d57:	85 c0                	test   %eax,%eax
80104d59:	78 15                	js     80104d70 <setupkvm+0x60>
  for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
80104d5b:	83 c3 10             	add    $0x10,%ebx
80104d5e:	81 fb 60 93 10 80    	cmp    $0x80109360,%ebx
80104d64:	75 d6                	jne    80104d3c <setupkvm+0x2c>
}
80104d66:	8d 65 f8             	lea    -0x8(%ebp),%esp
80104d69:	89 f0                	mov    %esi,%eax
80104d6b:	5b                   	pop    %ebx
80104d6c:	5e                   	pop    %esi
80104d6d:	5d                   	pop    %ebp
80104d6e:	c3                   	ret    
80104d6f:	90                   	nop
      freevm(pgdir);
80104d70:	83 ec 0c             	sub    $0xc,%esp
80104d73:	56                   	push   %esi
      return 0;
80104d74:	31 f6                	xor    %esi,%esi
      freevm(pgdir);
80104d76:	e8 15 ff ff ff       	call   80104c90 <freevm>
      return 0;
80104d7b:	83 c4 10             	add    $0x10,%esp
}
80104d7e:	8d 65 f8             	lea    -0x8(%ebp),%esp
80104d81:	89 f0                	mov    %esi,%eax
80104d83:	5b                   	pop    %ebx
80104d84:	5e                   	pop    %esi
80104d85:	5d                   	pop    %ebp
80104d86:	c3                   	ret    
80104d87:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104d8e:	66 90                	xchg   %ax,%ax

80104d90 <kvmalloc>:
{
80104d90:	f3 0f 1e fb          	endbr32 
80104d94:	55                   	push   %ebp
80104d95:	89 e5                	mov    %esp,%ebp
80104d97:	83 ec 08             	sub    $0x8,%esp
  kpgdir = setupkvm();
80104d9a:	e8 71 ff ff ff       	call   80104d10 <setupkvm>
80104d9f:	a3 54 41 11 80       	mov    %eax,0x80114154
  lcr3(V2P(kpgdir));   // switch to the kernel page table
80104da4:	05 00 00 00 80       	add    $0x80000000,%eax
80104da9:	0f 22 d8             	mov    %eax,%cr3
}
80104dac:	c9                   	leave  
80104dad:	c3                   	ret    
80104dae:	66 90                	xchg   %ax,%ax

80104db0 <clearpteu>:

// Clear PTE_U on a page. Used to create an inaccessible
// page beneath the user stack.
void
clearpteu(pde_t *pgdir, char *uva)
{
80104db0:	f3 0f 1e fb          	endbr32 
80104db4:	55                   	push   %ebp
  pte_t *pte;

  pte = walkpgdir(pgdir, uva, 0);
80104db5:	31 c9                	xor    %ecx,%ecx
{
80104db7:	89 e5                	mov    %esp,%ebp
80104db9:	83 ec 08             	sub    $0x8,%esp
  pte = walkpgdir(pgdir, uva, 0);
80104dbc:	8b 55 0c             	mov    0xc(%ebp),%edx
80104dbf:	8b 45 08             	mov    0x8(%ebp),%eax
80104dc2:	e8 99 f8 ff ff       	call   80104660 <walkpgdir>
  if(pte == 0)
80104dc7:	85 c0                	test   %eax,%eax
80104dc9:	74 05                	je     80104dd0 <clearpteu+0x20>
    panic("clearpteu");
  *pte &= ~PTE_U;
80104dcb:	83 20 fb             	andl   $0xfffffffb,(%eax)
}
80104dce:	c9                   	leave  
80104dcf:	c3                   	ret    
    panic("clearpteu");
80104dd0:	83 ec 0c             	sub    $0xc,%esp
80104dd3:	68 a0 79 10 80       	push   $0x801079a0
80104dd8:	e8 e3 cb ff ff       	call   801019c0 <panic>
80104ddd:	8d 76 00             	lea    0x0(%esi),%esi

80104de0 <copyuvm>:

// Given a parent process's page table, create a copy
// of it for a child.
pde_t*
copyuvm(pde_t *pgdir, uint sz)
{
80104de0:	f3 0f 1e fb          	endbr32 
80104de4:	55                   	push   %ebp
80104de5:	89 e5                	mov    %esp,%ebp
80104de7:	57                   	push   %edi
80104de8:	56                   	push   %esi
80104de9:	53                   	push   %ebx
80104dea:	83 ec 1c             	sub    $0x1c,%esp
  pde_t *d;
  pte_t *pte;
  uint pa, i, flags;
  char *mem;

  if((d = setupkvm()) == 0)
80104ded:	e8 1e ff ff ff       	call   80104d10 <setupkvm>
80104df2:	89 45 e0             	mov    %eax,-0x20(%ebp)
80104df5:	85 c0                	test   %eax,%eax
80104df7:	0f 84 9b 00 00 00    	je     80104e98 <copyuvm+0xb8>
    return 0;
  for(i = 0; i < sz; i += PGSIZE){
80104dfd:	8b 4d 0c             	mov    0xc(%ebp),%ecx
80104e00:	85 c9                	test   %ecx,%ecx
80104e02:	0f 84 90 00 00 00    	je     80104e98 <copyuvm+0xb8>
80104e08:	31 f6                	xor    %esi,%esi
80104e0a:	eb 46                	jmp    80104e52 <copyuvm+0x72>
80104e0c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
      panic("copyuvm: page not present");
    pa = PTE_ADDR(*pte);
    flags = PTE_FLAGS(*pte);
    if((mem = kalloc()) == 0)
      goto bad;
    memmove(mem, (char*)P2V(pa), PGSIZE);
80104e10:	83 ec 04             	sub    $0x4,%esp
80104e13:	81 c7 00 00 00 80    	add    $0x80000000,%edi
80104e19:	68 00 10 00 00       	push   $0x1000
80104e1e:	57                   	push   %edi
80104e1f:	50                   	push   %eax
80104e20:	e8 4b 04 00 00       	call   80105270 <memmove>
    if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) {
80104e25:	58                   	pop    %eax
80104e26:	8d 83 00 00 00 80    	lea    -0x80000000(%ebx),%eax
80104e2c:	5a                   	pop    %edx
80104e2d:	ff 75 e4             	pushl  -0x1c(%ebp)
80104e30:	b9 00 10 00 00       	mov    $0x1000,%ecx
80104e35:	89 f2                	mov    %esi,%edx
80104e37:	50                   	push   %eax
80104e38:	8b 45 e0             	mov    -0x20(%ebp),%eax
80104e3b:	e8 a0 f8 ff ff       	call   801046e0 <mappages>
80104e40:	83 c4 10             	add    $0x10,%esp
80104e43:	85 c0                	test   %eax,%eax
80104e45:	78 61                	js     80104ea8 <copyuvm+0xc8>
  for(i = 0; i < sz; i += PGSIZE){
80104e47:	81 c6 00 10 00 00    	add    $0x1000,%esi
80104e4d:	39 75 0c             	cmp    %esi,0xc(%ebp)
80104e50:	76 46                	jbe    80104e98 <copyuvm+0xb8>
    if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
80104e52:	8b 45 08             	mov    0x8(%ebp),%eax
80104e55:	31 c9                	xor    %ecx,%ecx
80104e57:	89 f2                	mov    %esi,%edx
80104e59:	e8 02 f8 ff ff       	call   80104660 <walkpgdir>
80104e5e:	85 c0                	test   %eax,%eax
80104e60:	74 61                	je     80104ec3 <copyuvm+0xe3>
    if(!(*pte & PTE_P))
80104e62:	8b 00                	mov    (%eax),%eax
80104e64:	a8 01                	test   $0x1,%al
80104e66:	74 4e                	je     80104eb6 <copyuvm+0xd6>
    pa = PTE_ADDR(*pte);
80104e68:	89 c7                	mov    %eax,%edi
    flags = PTE_FLAGS(*pte);
80104e6a:	25 ff 0f 00 00       	and    $0xfff,%eax
80104e6f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    pa = PTE_ADDR(*pte);
80104e72:	81 e7 00 f0 ff ff    	and    $0xfffff000,%edi
    if((mem = kalloc()) == 0)
80104e78:	e8 e3 02 00 00       	call   80105160 <kalloc>
80104e7d:	89 c3                	mov    %eax,%ebx
80104e7f:	85 c0                	test   %eax,%eax
80104e81:	75 8d                	jne    80104e10 <copyuvm+0x30>
    }
  }
  return d;

bad:
  freevm(d);
80104e83:	83 ec 0c             	sub    $0xc,%esp
80104e86:	ff 75 e0             	pushl  -0x20(%ebp)
80104e89:	e8 02 fe ff ff       	call   80104c90 <freevm>
  return 0;
80104e8e:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
80104e95:	83 c4 10             	add    $0x10,%esp
}
80104e98:	8b 45 e0             	mov    -0x20(%ebp),%eax
80104e9b:	8d 65 f4             	lea    -0xc(%ebp),%esp
80104e9e:	5b                   	pop    %ebx
80104e9f:	5e                   	pop    %esi
80104ea0:	5f                   	pop    %edi
80104ea1:	5d                   	pop    %ebp
80104ea2:	c3                   	ret    
80104ea3:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80104ea7:	90                   	nop
      kfree(mem);
80104ea8:	83 ec 0c             	sub    $0xc,%esp
80104eab:	53                   	push   %ebx
80104eac:	e8 ef 00 00 00       	call   80104fa0 <kfree>
      goto bad;
80104eb1:	83 c4 10             	add    $0x10,%esp
80104eb4:	eb cd                	jmp    80104e83 <copyuvm+0xa3>
      panic("copyuvm: page not present");
80104eb6:	83 ec 0c             	sub    $0xc,%esp
80104eb9:	68 c4 79 10 80       	push   $0x801079c4
80104ebe:	e8 fd ca ff ff       	call   801019c0 <panic>
      panic("copyuvm: pte should exist");
80104ec3:	83 ec 0c             	sub    $0xc,%esp
80104ec6:	68 aa 79 10 80       	push   $0x801079aa
80104ecb:	e8 f0 ca ff ff       	call   801019c0 <panic>

80104ed0 <uva2ka>:

//PAGEBREAK!
// Map user virtual address to kernel address.
char*
uva2ka(pde_t *pgdir, char *uva)
{
80104ed0:	f3 0f 1e fb          	endbr32 
80104ed4:	55                   	push   %ebp
  pte_t *pte;

  pte = walkpgdir(pgdir, uva, 0);
80104ed5:	31 c9                	xor    %ecx,%ecx
{
80104ed7:	89 e5                	mov    %esp,%ebp
80104ed9:	83 ec 08             	sub    $0x8,%esp
  pte = walkpgdir(pgdir, uva, 0);
80104edc:	8b 55 0c             	mov    0xc(%ebp),%edx
80104edf:	8b 45 08             	mov    0x8(%ebp),%eax
80104ee2:	e8 79 f7 ff ff       	call   80104660 <walkpgdir>
  if((*pte & PTE_P) == 0)
80104ee7:	8b 00                	mov    (%eax),%eax
    return 0;
  if((*pte & PTE_U) == 0)
    return 0;
  return (char*)P2V(PTE_ADDR(*pte));
}
80104ee9:	c9                   	leave  
  if((*pte & PTE_U) == 0)
80104eea:	89 c2                	mov    %eax,%edx
  return (char*)P2V(PTE_ADDR(*pte));
80104eec:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  if((*pte & PTE_U) == 0)
80104ef1:	83 e2 05             	and    $0x5,%edx
  return (char*)P2V(PTE_ADDR(*pte));
80104ef4:	05 00 00 00 80       	add    $0x80000000,%eax
80104ef9:	83 fa 05             	cmp    $0x5,%edx
80104efc:	ba 00 00 00 00       	mov    $0x0,%edx
80104f01:	0f 45 c2             	cmovne %edx,%eax
}
80104f04:	c3                   	ret    
80104f05:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104f0c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80104f10 <copyout>:
// Copy len bytes from p to user address va in page table pgdir.
// Most useful when pgdir is not the current page table.
// uva2ka ensures this only works for PTE_U pages.
int
copyout(pde_t *pgdir, uint va, void *p, uint len)
{
80104f10:	f3 0f 1e fb          	endbr32 
80104f14:	55                   	push   %ebp
80104f15:	89 e5                	mov    %esp,%ebp
80104f17:	57                   	push   %edi
80104f18:	56                   	push   %esi
80104f19:	53                   	push   %ebx
80104f1a:	83 ec 0c             	sub    $0xc,%esp
80104f1d:	8b 75 14             	mov    0x14(%ebp),%esi
80104f20:	8b 55 0c             	mov    0xc(%ebp),%edx
  char *buf, *pa0;
  uint n, va0;

  buf = (char*)p;
  while(len > 0){
80104f23:	85 f6                	test   %esi,%esi
80104f25:	75 3c                	jne    80104f63 <copyout+0x53>
80104f27:	eb 67                	jmp    80104f90 <copyout+0x80>
80104f29:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    va0 = (uint)PGROUNDDOWN(va);
    pa0 = uva2ka(pgdir, (char*)va0);
    if(pa0 == 0)
      return -1;
    n = PGSIZE - (va - va0);
80104f30:	8b 55 0c             	mov    0xc(%ebp),%edx
80104f33:	89 fb                	mov    %edi,%ebx
80104f35:	29 d3                	sub    %edx,%ebx
80104f37:	81 c3 00 10 00 00    	add    $0x1000,%ebx
    if(n > len)
80104f3d:	39 f3                	cmp    %esi,%ebx
80104f3f:	0f 47 de             	cmova  %esi,%ebx
      n = len;
    memmove(pa0 + (va - va0), buf, n);
80104f42:	29 fa                	sub    %edi,%edx
80104f44:	83 ec 04             	sub    $0x4,%esp
80104f47:	01 c2                	add    %eax,%edx
80104f49:	53                   	push   %ebx
80104f4a:	ff 75 10             	pushl  0x10(%ebp)
80104f4d:	52                   	push   %edx
80104f4e:	e8 1d 03 00 00       	call   80105270 <memmove>
    len -= n;
    buf += n;
80104f53:	01 5d 10             	add    %ebx,0x10(%ebp)
    va = va0 + PGSIZE;
80104f56:	8d 97 00 10 00 00    	lea    0x1000(%edi),%edx
  while(len > 0){
80104f5c:	83 c4 10             	add    $0x10,%esp
80104f5f:	29 de                	sub    %ebx,%esi
80104f61:	74 2d                	je     80104f90 <copyout+0x80>
    va0 = (uint)PGROUNDDOWN(va);
80104f63:	89 d7                	mov    %edx,%edi
    pa0 = uva2ka(pgdir, (char*)va0);
80104f65:	83 ec 08             	sub    $0x8,%esp
    va0 = (uint)PGROUNDDOWN(va);
80104f68:	89 55 0c             	mov    %edx,0xc(%ebp)
80104f6b:	81 e7 00 f0 ff ff    	and    $0xfffff000,%edi
    pa0 = uva2ka(pgdir, (char*)va0);
80104f71:	57                   	push   %edi
80104f72:	ff 75 08             	pushl  0x8(%ebp)
80104f75:	e8 56 ff ff ff       	call   80104ed0 <uva2ka>
    if(pa0 == 0)
80104f7a:	83 c4 10             	add    $0x10,%esp
80104f7d:	85 c0                	test   %eax,%eax
80104f7f:	75 af                	jne    80104f30 <copyout+0x20>
  }
  return 0;
}
80104f81:	8d 65 f4             	lea    -0xc(%ebp),%esp
      return -1;
80104f84:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80104f89:	5b                   	pop    %ebx
80104f8a:	5e                   	pop    %esi
80104f8b:	5f                   	pop    %edi
80104f8c:	5d                   	pop    %ebp
80104f8d:	c3                   	ret    
80104f8e:	66 90                	xchg   %ax,%ax
80104f90:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return 0;
80104f93:	31 c0                	xor    %eax,%eax
}
80104f95:	5b                   	pop    %ebx
80104f96:	5e                   	pop    %esi
80104f97:	5f                   	pop    %edi
80104f98:	5d                   	pop    %ebp
80104f99:	c3                   	ret    
80104f9a:	66 90                	xchg   %ax,%ax
80104f9c:	66 90                	xchg   %ax,%ax
80104f9e:	66 90                	xchg   %ax,%ax

80104fa0 <kfree>:
// which normally should have been returned by a
// call to kalloc().  (The exception is when
// initializing the allocator; see kinit above.)
void
kfree(char *v)
{
80104fa0:	f3 0f 1e fb          	endbr32 
80104fa4:	55                   	push   %ebp
80104fa5:	89 e5                	mov    %esp,%ebp
80104fa7:	53                   	push   %ebx
80104fa8:	83 ec 04             	sub    $0x4,%esp
80104fab:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct run *r;

  if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP)
80104fae:	f7 c3 ff 0f 00 00    	test   $0xfff,%ebx
80104fb4:	75 7a                	jne    80105030 <kfree+0x90>
80104fb6:	81 fb e4 49 11 80    	cmp    $0x801149e4,%ebx
80104fbc:	72 72                	jb     80105030 <kfree+0x90>
80104fbe:	8d 83 00 00 00 80    	lea    -0x80000000(%ebx),%eax
80104fc4:	3d ff ff ff 0d       	cmp    $0xdffffff,%eax
80104fc9:	77 65                	ja     80105030 <kfree+0x90>
    panic("kfree");

  // Fill with junk to catch dangling refs.
  memset(v, 1, PGSIZE);
80104fcb:	83 ec 04             	sub    $0x4,%esp
80104fce:	68 00 10 00 00       	push   $0x1000
80104fd3:	6a 01                	push   $0x1
80104fd5:	53                   	push   %ebx
80104fd6:	e8 f5 01 00 00       	call   801051d0 <memset>

  if(kmem.use_lock)
80104fdb:	8b 15 94 41 11 80    	mov    0x80114194,%edx
80104fe1:	83 c4 10             	add    $0x10,%esp
80104fe4:	85 d2                	test   %edx,%edx
80104fe6:	75 20                	jne    80105008 <kfree+0x68>
    acquire(&kmem.lock);
  r = (struct run*)v;
  r->next = kmem.freelist;
80104fe8:	a1 98 41 11 80       	mov    0x80114198,%eax
80104fed:	89 03                	mov    %eax,(%ebx)
  kmem.freelist = r;
  if(kmem.use_lock)
80104fef:	a1 94 41 11 80       	mov    0x80114194,%eax
  kmem.freelist = r;
80104ff4:	89 1d 98 41 11 80    	mov    %ebx,0x80114198
  if(kmem.use_lock)
80104ffa:	85 c0                	test   %eax,%eax
80104ffc:	75 22                	jne    80105020 <kfree+0x80>
    release(&kmem.lock);
}
80104ffe:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80105001:	c9                   	leave  
80105002:	c3                   	ret    
80105003:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80105007:	90                   	nop
    acquire(&kmem.lock);
80105008:	83 ec 0c             	sub    $0xc,%esp
8010500b:	68 60 41 11 80       	push   $0x80114160
80105010:	e8 7b b4 ff ff       	call   80100490 <acquire>
80105015:	83 c4 10             	add    $0x10,%esp
80105018:	eb ce                	jmp    80104fe8 <kfree+0x48>
8010501a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    release(&kmem.lock);
80105020:	c7 45 08 60 41 11 80 	movl   $0x80114160,0x8(%ebp)
}
80105027:	8b 5d fc             	mov    -0x4(%ebp),%ebx
8010502a:	c9                   	leave  
    release(&kmem.lock);
8010502b:	e9 20 b5 ff ff       	jmp    80100550 <release>
    panic("kfree");
80105030:	83 ec 0c             	sub    $0xc,%esp
80105033:	68 de 78 10 80       	push   $0x801078de
80105038:	e8 83 c9 ff ff       	call   801019c0 <panic>
8010503d:	8d 76 00             	lea    0x0(%esi),%esi

80105040 <freerange>:
{
80105040:	f3 0f 1e fb          	endbr32 
80105044:	55                   	push   %ebp
80105045:	89 e5                	mov    %esp,%ebp
80105047:	56                   	push   %esi
  p = (char*)PGROUNDUP((uint)vstart);
80105048:	8b 45 08             	mov    0x8(%ebp),%eax
{
8010504b:	8b 75 0c             	mov    0xc(%ebp),%esi
8010504e:	53                   	push   %ebx
  p = (char*)PGROUNDUP((uint)vstart);
8010504f:	8d 98 ff 0f 00 00    	lea    0xfff(%eax),%ebx
80105055:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010505b:	81 c3 00 10 00 00    	add    $0x1000,%ebx
80105061:	39 de                	cmp    %ebx,%esi
80105063:	72 1f                	jb     80105084 <freerange+0x44>
80105065:	8d 76 00             	lea    0x0(%esi),%esi
    kfree(p);
80105068:	83 ec 0c             	sub    $0xc,%esp
8010506b:	8d 83 00 f0 ff ff    	lea    -0x1000(%ebx),%eax
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80105071:	81 c3 00 10 00 00    	add    $0x1000,%ebx
    kfree(p);
80105077:	50                   	push   %eax
80105078:	e8 23 ff ff ff       	call   80104fa0 <kfree>
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010507d:	83 c4 10             	add    $0x10,%esp
80105080:	39 f3                	cmp    %esi,%ebx
80105082:	76 e4                	jbe    80105068 <freerange+0x28>
}
80105084:	8d 65 f8             	lea    -0x8(%ebp),%esp
80105087:	5b                   	pop    %ebx
80105088:	5e                   	pop    %esi
80105089:	5d                   	pop    %ebp
8010508a:	c3                   	ret    
8010508b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010508f:	90                   	nop

80105090 <kinit1>:
{
80105090:	f3 0f 1e fb          	endbr32 
80105094:	55                   	push   %ebp
80105095:	89 e5                	mov    %esp,%ebp
80105097:	56                   	push   %esi
80105098:	53                   	push   %ebx
80105099:	8b 75 0c             	mov    0xc(%ebp),%esi
  initlock(&kmem.lock, "kmem");
8010509c:	83 ec 08             	sub    $0x8,%esp
8010509f:	68 03 7a 10 80       	push   $0x80107a03
801050a4:	68 60 41 11 80       	push   $0x80114160
801050a9:	e8 62 b2 ff ff       	call   80100310 <initlock>
  p = (char*)PGROUNDUP((uint)vstart);
801050ae:	8b 45 08             	mov    0x8(%ebp),%eax
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801050b1:	83 c4 10             	add    $0x10,%esp
  kmem.use_lock = 0;
801050b4:	c7 05 94 41 11 80 00 	movl   $0x0,0x80114194
801050bb:	00 00 00 
  p = (char*)PGROUNDUP((uint)vstart);
801050be:	8d 98 ff 0f 00 00    	lea    0xfff(%eax),%ebx
801050c4:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801050ca:	81 c3 00 10 00 00    	add    $0x1000,%ebx
801050d0:	39 de                	cmp    %ebx,%esi
801050d2:	72 20                	jb     801050f4 <kinit1+0x64>
801050d4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    kfree(p);
801050d8:	83 ec 0c             	sub    $0xc,%esp
801050db:	8d 83 00 f0 ff ff    	lea    -0x1000(%ebx),%eax
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801050e1:	81 c3 00 10 00 00    	add    $0x1000,%ebx
    kfree(p);
801050e7:	50                   	push   %eax
801050e8:	e8 b3 fe ff ff       	call   80104fa0 <kfree>
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801050ed:	83 c4 10             	add    $0x10,%esp
801050f0:	39 de                	cmp    %ebx,%esi
801050f2:	73 e4                	jae    801050d8 <kinit1+0x48>
}
801050f4:	8d 65 f8             	lea    -0x8(%ebp),%esp
801050f7:	5b                   	pop    %ebx
801050f8:	5e                   	pop    %esi
801050f9:	5d                   	pop    %ebp
801050fa:	c3                   	ret    
801050fb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801050ff:	90                   	nop

80105100 <kinit2>:
{
80105100:	f3 0f 1e fb          	endbr32 
80105104:	55                   	push   %ebp
80105105:	89 e5                	mov    %esp,%ebp
80105107:	56                   	push   %esi
  p = (char*)PGROUNDUP((uint)vstart);
80105108:	8b 45 08             	mov    0x8(%ebp),%eax
{
8010510b:	8b 75 0c             	mov    0xc(%ebp),%esi
8010510e:	53                   	push   %ebx
  p = (char*)PGROUNDUP((uint)vstart);
8010510f:	8d 98 ff 0f 00 00    	lea    0xfff(%eax),%ebx
80105115:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010511b:	81 c3 00 10 00 00    	add    $0x1000,%ebx
80105121:	39 de                	cmp    %ebx,%esi
80105123:	72 1f                	jb     80105144 <kinit2+0x44>
80105125:	8d 76 00             	lea    0x0(%esi),%esi
    kfree(p);
80105128:	83 ec 0c             	sub    $0xc,%esp
8010512b:	8d 83 00 f0 ff ff    	lea    -0x1000(%ebx),%eax
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80105131:	81 c3 00 10 00 00    	add    $0x1000,%ebx
    kfree(p);
80105137:	50                   	push   %eax
80105138:	e8 63 fe ff ff       	call   80104fa0 <kfree>
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010513d:	83 c4 10             	add    $0x10,%esp
80105140:	39 de                	cmp    %ebx,%esi
80105142:	73 e4                	jae    80105128 <kinit2+0x28>
  kmem.use_lock = 1;
80105144:	c7 05 94 41 11 80 01 	movl   $0x1,0x80114194
8010514b:	00 00 00 
}
8010514e:	8d 65 f8             	lea    -0x8(%ebp),%esp
80105151:	5b                   	pop    %ebx
80105152:	5e                   	pop    %esi
80105153:	5d                   	pop    %ebp
80105154:	c3                   	ret    
80105155:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010515c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80105160 <kalloc>:
// Allocate one 4096-byte page of physical memory.
// Returns a pointer that the kernel can use.
// Returns 0 if the memory cannot be allocated.
char*
kalloc(void)
{
80105160:	f3 0f 1e fb          	endbr32 
  struct run *r;

  if(kmem.use_lock)
80105164:	a1 94 41 11 80       	mov    0x80114194,%eax
80105169:	85 c0                	test   %eax,%eax
8010516b:	75 1b                	jne    80105188 <kalloc+0x28>
    acquire(&kmem.lock);
  r = kmem.freelist;
8010516d:	a1 98 41 11 80       	mov    0x80114198,%eax
  if(r)
80105172:	85 c0                	test   %eax,%eax
80105174:	74 0a                	je     80105180 <kalloc+0x20>
    kmem.freelist = r->next;
80105176:	8b 10                	mov    (%eax),%edx
80105178:	89 15 98 41 11 80    	mov    %edx,0x80114198
  if(kmem.use_lock)
8010517e:	c3                   	ret    
8010517f:	90                   	nop
    release(&kmem.lock);
  return (char*)r;
}
80105180:	c3                   	ret    
80105181:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
{
80105188:	55                   	push   %ebp
80105189:	89 e5                	mov    %esp,%ebp
8010518b:	83 ec 24             	sub    $0x24,%esp
    acquire(&kmem.lock);
8010518e:	68 60 41 11 80       	push   $0x80114160
80105193:	e8 f8 b2 ff ff       	call   80100490 <acquire>
  r = kmem.freelist;
80105198:	a1 98 41 11 80       	mov    0x80114198,%eax
  if(r)
8010519d:	8b 15 94 41 11 80    	mov    0x80114194,%edx
801051a3:	83 c4 10             	add    $0x10,%esp
801051a6:	85 c0                	test   %eax,%eax
801051a8:	74 08                	je     801051b2 <kalloc+0x52>
    kmem.freelist = r->next;
801051aa:	8b 08                	mov    (%eax),%ecx
801051ac:	89 0d 98 41 11 80    	mov    %ecx,0x80114198
  if(kmem.use_lock)
801051b2:	85 d2                	test   %edx,%edx
801051b4:	74 16                	je     801051cc <kalloc+0x6c>
    release(&kmem.lock);
801051b6:	83 ec 0c             	sub    $0xc,%esp
801051b9:	89 45 f4             	mov    %eax,-0xc(%ebp)
801051bc:	68 60 41 11 80       	push   $0x80114160
801051c1:	e8 8a b3 ff ff       	call   80100550 <release>
  return (char*)r;
801051c6:	8b 45 f4             	mov    -0xc(%ebp),%eax
    release(&kmem.lock);
801051c9:	83 c4 10             	add    $0x10,%esp
}
801051cc:	c9                   	leave  
801051cd:	c3                   	ret    
801051ce:	66 90                	xchg   %ax,%ax

801051d0 <memset>:
#include "types.h"
#include "x86.h"

void*
memset(void *dst, int c, uint n)
{
801051d0:	f3 0f 1e fb          	endbr32 
801051d4:	55                   	push   %ebp
801051d5:	89 e5                	mov    %esp,%ebp
801051d7:	57                   	push   %edi
801051d8:	8b 55 08             	mov    0x8(%ebp),%edx
801051db:	8b 4d 10             	mov    0x10(%ebp),%ecx
801051de:	53                   	push   %ebx
801051df:	8b 45 0c             	mov    0xc(%ebp),%eax
  if ((int)dst%4 == 0 && n%4 == 0){
801051e2:	89 d7                	mov    %edx,%edi
801051e4:	09 cf                	or     %ecx,%edi
801051e6:	83 e7 03             	and    $0x3,%edi
801051e9:	75 25                	jne    80105210 <memset+0x40>
    c &= 0xFF;
801051eb:	0f b6 f8             	movzbl %al,%edi
    stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4);
801051ee:	c1 e0 18             	shl    $0x18,%eax
801051f1:	89 fb                	mov    %edi,%ebx
801051f3:	c1 e9 02             	shr    $0x2,%ecx
801051f6:	c1 e3 10             	shl    $0x10,%ebx
801051f9:	09 d8                	or     %ebx,%eax
801051fb:	09 f8                	or     %edi,%eax
801051fd:	c1 e7 08             	shl    $0x8,%edi
80105200:	09 f8                	or     %edi,%eax
  asm volatile("cld; rep stosl" :
80105202:	89 d7                	mov    %edx,%edi
80105204:	fc                   	cld    
80105205:	f3 ab                	rep stos %eax,%es:(%edi)
  } else
    stosb(dst, c, n);
  return dst;
}
80105207:	5b                   	pop    %ebx
80105208:	89 d0                	mov    %edx,%eax
8010520a:	5f                   	pop    %edi
8010520b:	5d                   	pop    %ebp
8010520c:	c3                   	ret    
8010520d:	8d 76 00             	lea    0x0(%esi),%esi
  asm volatile("cld; rep stosb" :
80105210:	89 d7                	mov    %edx,%edi
80105212:	fc                   	cld    
80105213:	f3 aa                	rep stos %al,%es:(%edi)
80105215:	5b                   	pop    %ebx
80105216:	89 d0                	mov    %edx,%eax
80105218:	5f                   	pop    %edi
80105219:	5d                   	pop    %ebp
8010521a:	c3                   	ret    
8010521b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010521f:	90                   	nop

80105220 <memcmp>:

int
memcmp(const void *v1, const void *v2, uint n)
{
80105220:	f3 0f 1e fb          	endbr32 
80105224:	55                   	push   %ebp
80105225:	89 e5                	mov    %esp,%ebp
80105227:	56                   	push   %esi
80105228:	8b 75 10             	mov    0x10(%ebp),%esi
8010522b:	8b 55 08             	mov    0x8(%ebp),%edx
8010522e:	53                   	push   %ebx
8010522f:	8b 45 0c             	mov    0xc(%ebp),%eax
  const uchar *s1, *s2;

  s1 = v1;
  s2 = v2;
  while(n-- > 0){
80105232:	85 f6                	test   %esi,%esi
80105234:	74 2a                	je     80105260 <memcmp+0x40>
80105236:	01 c6                	add    %eax,%esi
80105238:	eb 10                	jmp    8010524a <memcmp+0x2a>
8010523a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    if(*s1 != *s2)
      return *s1 - *s2;
    s1++, s2++;
80105240:	83 c0 01             	add    $0x1,%eax
80105243:	83 c2 01             	add    $0x1,%edx
  while(n-- > 0){
80105246:	39 f0                	cmp    %esi,%eax
80105248:	74 16                	je     80105260 <memcmp+0x40>
    if(*s1 != *s2)
8010524a:	0f b6 0a             	movzbl (%edx),%ecx
8010524d:	0f b6 18             	movzbl (%eax),%ebx
80105250:	38 d9                	cmp    %bl,%cl
80105252:	74 ec                	je     80105240 <memcmp+0x20>
      return *s1 - *s2;
80105254:	0f b6 c1             	movzbl %cl,%eax
80105257:	29 d8                	sub    %ebx,%eax
  }

  return 0;
}
80105259:	5b                   	pop    %ebx
8010525a:	5e                   	pop    %esi
8010525b:	5d                   	pop    %ebp
8010525c:	c3                   	ret    
8010525d:	8d 76 00             	lea    0x0(%esi),%esi
80105260:	5b                   	pop    %ebx
  return 0;
80105261:	31 c0                	xor    %eax,%eax
}
80105263:	5e                   	pop    %esi
80105264:	5d                   	pop    %ebp
80105265:	c3                   	ret    
80105266:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010526d:	8d 76 00             	lea    0x0(%esi),%esi

80105270 <memmove>:

void*
memmove(void *dst, const void *src, uint n)
{
80105270:	f3 0f 1e fb          	endbr32 
80105274:	55                   	push   %ebp
80105275:	89 e5                	mov    %esp,%ebp
80105277:	57                   	push   %edi
80105278:	8b 55 08             	mov    0x8(%ebp),%edx
8010527b:	8b 4d 10             	mov    0x10(%ebp),%ecx
8010527e:	56                   	push   %esi
8010527f:	8b 75 0c             	mov    0xc(%ebp),%esi
  const char *s;
  char *d;

  s = src;
  d = dst;
  if(s < d && s + n > d){
80105282:	39 d6                	cmp    %edx,%esi
80105284:	73 2a                	jae    801052b0 <memmove+0x40>
80105286:	8d 3c 0e             	lea    (%esi,%ecx,1),%edi
80105289:	39 fa                	cmp    %edi,%edx
8010528b:	73 23                	jae    801052b0 <memmove+0x40>
8010528d:	8d 41 ff             	lea    -0x1(%ecx),%eax
    s += n;
    d += n;
    while(n-- > 0)
80105290:	85 c9                	test   %ecx,%ecx
80105292:	74 13                	je     801052a7 <memmove+0x37>
80105294:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
      *--d = *--s;
80105298:	0f b6 0c 06          	movzbl (%esi,%eax,1),%ecx
8010529c:	88 0c 02             	mov    %cl,(%edx,%eax,1)
    while(n-- > 0)
8010529f:	83 e8 01             	sub    $0x1,%eax
801052a2:	83 f8 ff             	cmp    $0xffffffff,%eax
801052a5:	75 f1                	jne    80105298 <memmove+0x28>
  } else
    while(n-- > 0)
      *d++ = *s++;

  return dst;
}
801052a7:	5e                   	pop    %esi
801052a8:	89 d0                	mov    %edx,%eax
801052aa:	5f                   	pop    %edi
801052ab:	5d                   	pop    %ebp
801052ac:	c3                   	ret    
801052ad:	8d 76 00             	lea    0x0(%esi),%esi
    while(n-- > 0)
801052b0:	8d 04 0e             	lea    (%esi,%ecx,1),%eax
801052b3:	89 d7                	mov    %edx,%edi
801052b5:	85 c9                	test   %ecx,%ecx
801052b7:	74 ee                	je     801052a7 <memmove+0x37>
801052b9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
      *d++ = *s++;
801052c0:	a4                   	movsb  %ds:(%esi),%es:(%edi)
    while(n-- > 0)
801052c1:	39 f0                	cmp    %esi,%eax
801052c3:	75 fb                	jne    801052c0 <memmove+0x50>
}
801052c5:	5e                   	pop    %esi
801052c6:	89 d0                	mov    %edx,%eax
801052c8:	5f                   	pop    %edi
801052c9:	5d                   	pop    %ebp
801052ca:	c3                   	ret    
801052cb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801052cf:	90                   	nop

801052d0 <memcpy>:

// memcpy exists to placate GCC.  Use memmove.
void*
memcpy(void *dst, const void *src, uint n)
{
801052d0:	f3 0f 1e fb          	endbr32 
  return memmove(dst, src, n);
801052d4:	eb 9a                	jmp    80105270 <memmove>
801052d6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801052dd:	8d 76 00             	lea    0x0(%esi),%esi

801052e0 <strncmp>:
}

int
strncmp(const char *p, const char *q, uint n)
{
801052e0:	f3 0f 1e fb          	endbr32 
801052e4:	55                   	push   %ebp
801052e5:	89 e5                	mov    %esp,%ebp
801052e7:	56                   	push   %esi
801052e8:	8b 75 10             	mov    0x10(%ebp),%esi
801052eb:	8b 4d 08             	mov    0x8(%ebp),%ecx
801052ee:	53                   	push   %ebx
801052ef:	8b 45 0c             	mov    0xc(%ebp),%eax
  while(n > 0 && *p && *p == *q)
801052f2:	85 f6                	test   %esi,%esi
801052f4:	74 32                	je     80105328 <strncmp+0x48>
801052f6:	01 c6                	add    %eax,%esi
801052f8:	eb 14                	jmp    8010530e <strncmp+0x2e>
801052fa:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80105300:	38 da                	cmp    %bl,%dl
80105302:	75 14                	jne    80105318 <strncmp+0x38>
    n--, p++, q++;
80105304:	83 c0 01             	add    $0x1,%eax
80105307:	83 c1 01             	add    $0x1,%ecx
  while(n > 0 && *p && *p == *q)
8010530a:	39 f0                	cmp    %esi,%eax
8010530c:	74 1a                	je     80105328 <strncmp+0x48>
8010530e:	0f b6 11             	movzbl (%ecx),%edx
80105311:	0f b6 18             	movzbl (%eax),%ebx
80105314:	84 d2                	test   %dl,%dl
80105316:	75 e8                	jne    80105300 <strncmp+0x20>
  if(n == 0)
    return 0;
  return (uchar)*p - (uchar)*q;
80105318:	0f b6 c2             	movzbl %dl,%eax
8010531b:	29 d8                	sub    %ebx,%eax
}
8010531d:	5b                   	pop    %ebx
8010531e:	5e                   	pop    %esi
8010531f:	5d                   	pop    %ebp
80105320:	c3                   	ret    
80105321:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105328:	5b                   	pop    %ebx
    return 0;
80105329:	31 c0                	xor    %eax,%eax
}
8010532b:	5e                   	pop    %esi
8010532c:	5d                   	pop    %ebp
8010532d:	c3                   	ret    
8010532e:	66 90                	xchg   %ax,%ax

80105330 <strncpy>:

char*
strncpy(char *s, const char *t, int n)
{
80105330:	f3 0f 1e fb          	endbr32 
80105334:	55                   	push   %ebp
80105335:	89 e5                	mov    %esp,%ebp
80105337:	57                   	push   %edi
80105338:	56                   	push   %esi
80105339:	8b 75 08             	mov    0x8(%ebp),%esi
8010533c:	53                   	push   %ebx
8010533d:	8b 45 10             	mov    0x10(%ebp),%eax
  char *os;

  os = s;
  while(n-- > 0 && (*s++ = *t++) != 0)
80105340:	89 f2                	mov    %esi,%edx
80105342:	eb 1b                	jmp    8010535f <strncpy+0x2f>
80105344:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80105348:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
8010534c:	8b 7d 0c             	mov    0xc(%ebp),%edi
8010534f:	83 c2 01             	add    $0x1,%edx
80105352:	0f b6 7f ff          	movzbl -0x1(%edi),%edi
80105356:	89 f9                	mov    %edi,%ecx
80105358:	88 4a ff             	mov    %cl,-0x1(%edx)
8010535b:	84 c9                	test   %cl,%cl
8010535d:	74 09                	je     80105368 <strncpy+0x38>
8010535f:	89 c3                	mov    %eax,%ebx
80105361:	83 e8 01             	sub    $0x1,%eax
80105364:	85 db                	test   %ebx,%ebx
80105366:	7f e0                	jg     80105348 <strncpy+0x18>
    ;
  while(n-- > 0)
80105368:	89 d1                	mov    %edx,%ecx
8010536a:	85 c0                	test   %eax,%eax
8010536c:	7e 15                	jle    80105383 <strncpy+0x53>
8010536e:	66 90                	xchg   %ax,%ax
    *s++ = 0;
80105370:	83 c1 01             	add    $0x1,%ecx
80105373:	c6 41 ff 00          	movb   $0x0,-0x1(%ecx)
  while(n-- > 0)
80105377:	89 c8                	mov    %ecx,%eax
80105379:	f7 d0                	not    %eax
8010537b:	01 d0                	add    %edx,%eax
8010537d:	01 d8                	add    %ebx,%eax
8010537f:	85 c0                	test   %eax,%eax
80105381:	7f ed                	jg     80105370 <strncpy+0x40>
  return os;
}
80105383:	5b                   	pop    %ebx
80105384:	89 f0                	mov    %esi,%eax
80105386:	5e                   	pop    %esi
80105387:	5f                   	pop    %edi
80105388:	5d                   	pop    %ebp
80105389:	c3                   	ret    
8010538a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80105390 <safestrcpy>:

// Like strncpy but guaranteed to NUL-terminate.
char*
safestrcpy(char *s, const char *t, int n)
{
80105390:	f3 0f 1e fb          	endbr32 
80105394:	55                   	push   %ebp
80105395:	89 e5                	mov    %esp,%ebp
80105397:	56                   	push   %esi
80105398:	8b 55 10             	mov    0x10(%ebp),%edx
8010539b:	8b 75 08             	mov    0x8(%ebp),%esi
8010539e:	53                   	push   %ebx
8010539f:	8b 45 0c             	mov    0xc(%ebp),%eax
  char *os;

  os = s;
  if(n <= 0)
801053a2:	85 d2                	test   %edx,%edx
801053a4:	7e 21                	jle    801053c7 <safestrcpy+0x37>
801053a6:	8d 5c 10 ff          	lea    -0x1(%eax,%edx,1),%ebx
801053aa:	89 f2                	mov    %esi,%edx
801053ac:	eb 12                	jmp    801053c0 <safestrcpy+0x30>
801053ae:	66 90                	xchg   %ax,%ax
    return os;
  while(--n > 0 && (*s++ = *t++) != 0)
801053b0:	0f b6 08             	movzbl (%eax),%ecx
801053b3:	83 c0 01             	add    $0x1,%eax
801053b6:	83 c2 01             	add    $0x1,%edx
801053b9:	88 4a ff             	mov    %cl,-0x1(%edx)
801053bc:	84 c9                	test   %cl,%cl
801053be:	74 04                	je     801053c4 <safestrcpy+0x34>
801053c0:	39 d8                	cmp    %ebx,%eax
801053c2:	75 ec                	jne    801053b0 <safestrcpy+0x20>
    ;
  *s = 0;
801053c4:	c6 02 00             	movb   $0x0,(%edx)
  return os;
}
801053c7:	89 f0                	mov    %esi,%eax
801053c9:	5b                   	pop    %ebx
801053ca:	5e                   	pop    %esi
801053cb:	5d                   	pop    %ebp
801053cc:	c3                   	ret    
801053cd:	8d 76 00             	lea    0x0(%esi),%esi

801053d0 <strlen>:

int
strlen(const char *s)
{
801053d0:	f3 0f 1e fb          	endbr32 
801053d4:	55                   	push   %ebp
  int n;

  for(n = 0; s[n]; n++)
801053d5:	31 c0                	xor    %eax,%eax
{
801053d7:	89 e5                	mov    %esp,%ebp
801053d9:	8b 55 08             	mov    0x8(%ebp),%edx
  for(n = 0; s[n]; n++)
801053dc:	80 3a 00             	cmpb   $0x0,(%edx)
801053df:	74 10                	je     801053f1 <strlen+0x21>
801053e1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801053e8:	83 c0 01             	add    $0x1,%eax
801053eb:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
801053ef:	75 f7                	jne    801053e8 <strlen+0x18>
    ;
  return n;
}
801053f1:	5d                   	pop    %ebp
801053f2:	c3                   	ret    

801053f3 <swtch>:
# a struct context, and save its address in *old.
# Switch stacks to new and pop previously-saved registers.

.globl swtch
swtch:
  movl 4(%esp), %eax
801053f3:	8b 44 24 04          	mov    0x4(%esp),%eax
  movl 8(%esp), %edx
801053f7:	8b 54 24 08          	mov    0x8(%esp),%edx

  # Save old callee-saved registers
  pushl %ebp
801053fb:	55                   	push   %ebp
  pushl %ebx
801053fc:	53                   	push   %ebx
  pushl %esi
801053fd:	56                   	push   %esi
  pushl %edi
801053fe:	57                   	push   %edi

  # Switch stacks
  movl %esp, (%eax)
801053ff:	89 20                	mov    %esp,(%eax)
  movl %edx, %esp
80105401:	89 d4                	mov    %edx,%esp

  # Load new callee-saved registers
  popl %edi
80105403:	5f                   	pop    %edi
  popl %esi
80105404:	5e                   	pop    %esi
  popl %ebx
80105405:	5b                   	pop    %ebx
  popl %ebp
80105406:	5d                   	pop    %ebp
  ret
80105407:	c3                   	ret    
80105408:	66 90                	xchg   %ax,%ax
8010540a:	66 90                	xchg   %ax,%ax
8010540c:	66 90                	xchg   %ax,%ax
8010540e:	66 90                	xchg   %ax,%ax

80105410 <fetchint>:
// to a saved program counter, and then the first argument.

// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
80105410:	f3 0f 1e fb          	endbr32 
80105414:	55                   	push   %ebp
80105415:	89 e5                	mov    %esp,%ebp
80105417:	53                   	push   %ebx
80105418:	83 ec 04             	sub    $0x4,%esp
8010541b:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct proc *curproc = myproc();
8010541e:	e8 1d e5 ff ff       	call   80103940 <myproc>

  if(addr >= curproc->sz || addr+4 > curproc->sz)
80105423:	8b 00                	mov    (%eax),%eax
80105425:	39 d8                	cmp    %ebx,%eax
80105427:	76 17                	jbe    80105440 <fetchint+0x30>
80105429:	8d 53 04             	lea    0x4(%ebx),%edx
8010542c:	39 d0                	cmp    %edx,%eax
8010542e:	72 10                	jb     80105440 <fetchint+0x30>
    return -1;
  *ip = *(int*)(addr);
80105430:	8b 45 0c             	mov    0xc(%ebp),%eax
80105433:	8b 13                	mov    (%ebx),%edx
80105435:	89 10                	mov    %edx,(%eax)
  return 0;
80105437:	31 c0                	xor    %eax,%eax
}
80105439:	83 c4 04             	add    $0x4,%esp
8010543c:	5b                   	pop    %ebx
8010543d:	5d                   	pop    %ebp
8010543e:	c3                   	ret    
8010543f:	90                   	nop
    return -1;
80105440:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105445:	eb f2                	jmp    80105439 <fetchint+0x29>
80105447:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010544e:	66 90                	xchg   %ax,%ax

80105450 <fetchstr>:
// Fetch the nul-terminated string at addr from the current process.
// Doesn't actually copy the string - just sets *pp to point at it.
// Returns length of string, not including nul.
int
fetchstr(uint addr, char **pp)
{
80105450:	f3 0f 1e fb          	endbr32 
80105454:	55                   	push   %ebp
80105455:	89 e5                	mov    %esp,%ebp
80105457:	53                   	push   %ebx
80105458:	83 ec 04             	sub    $0x4,%esp
8010545b:	8b 5d 08             	mov    0x8(%ebp),%ebx
  char *s, *ep;
  struct proc *curproc = myproc();
8010545e:	e8 dd e4 ff ff       	call   80103940 <myproc>

  if(addr >= curproc->sz)
80105463:	39 18                	cmp    %ebx,(%eax)
80105465:	76 31                	jbe    80105498 <fetchstr+0x48>
    return -1;
  *pp = (char*)addr;
80105467:	8b 55 0c             	mov    0xc(%ebp),%edx
8010546a:	89 1a                	mov    %ebx,(%edx)
  ep = (char*)curproc->sz;
8010546c:	8b 10                	mov    (%eax),%edx
  for(s = *pp; s < ep; s++){
8010546e:	39 d3                	cmp    %edx,%ebx
80105470:	73 26                	jae    80105498 <fetchstr+0x48>
80105472:	89 d8                	mov    %ebx,%eax
80105474:	eb 11                	jmp    80105487 <fetchstr+0x37>
80105476:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010547d:	8d 76 00             	lea    0x0(%esi),%esi
80105480:	83 c0 01             	add    $0x1,%eax
80105483:	39 c2                	cmp    %eax,%edx
80105485:	76 11                	jbe    80105498 <fetchstr+0x48>
    if(*s == 0)
80105487:	80 38 00             	cmpb   $0x0,(%eax)
8010548a:	75 f4                	jne    80105480 <fetchstr+0x30>
      return s - *pp;
  }
  return -1;
}
8010548c:	83 c4 04             	add    $0x4,%esp
      return s - *pp;
8010548f:	29 d8                	sub    %ebx,%eax
}
80105491:	5b                   	pop    %ebx
80105492:	5d                   	pop    %ebp
80105493:	c3                   	ret    
80105494:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80105498:	83 c4 04             	add    $0x4,%esp
    return -1;
8010549b:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
801054a0:	5b                   	pop    %ebx
801054a1:	5d                   	pop    %ebp
801054a2:	c3                   	ret    
801054a3:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801054aa:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801054b0 <argint>:

// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
801054b0:	f3 0f 1e fb          	endbr32 
801054b4:	55                   	push   %ebp
801054b5:	89 e5                	mov    %esp,%ebp
801054b7:	56                   	push   %esi
801054b8:	53                   	push   %ebx
  return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
801054b9:	e8 82 e4 ff ff       	call   80103940 <myproc>
801054be:	8b 55 08             	mov    0x8(%ebp),%edx
801054c1:	8b 40 18             	mov    0x18(%eax),%eax
801054c4:	8b 40 44             	mov    0x44(%eax),%eax
801054c7:	8d 1c 90             	lea    (%eax,%edx,4),%ebx
  struct proc *curproc = myproc();
801054ca:	e8 71 e4 ff ff       	call   80103940 <myproc>
  return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
801054cf:	8d 73 04             	lea    0x4(%ebx),%esi
  if(addr >= curproc->sz || addr+4 > curproc->sz)
801054d2:	8b 00                	mov    (%eax),%eax
801054d4:	39 c6                	cmp    %eax,%esi
801054d6:	73 18                	jae    801054f0 <argint+0x40>
801054d8:	8d 53 08             	lea    0x8(%ebx),%edx
801054db:	39 d0                	cmp    %edx,%eax
801054dd:	72 11                	jb     801054f0 <argint+0x40>
  *ip = *(int*)(addr);
801054df:	8b 45 0c             	mov    0xc(%ebp),%eax
801054e2:	8b 53 04             	mov    0x4(%ebx),%edx
801054e5:	89 10                	mov    %edx,(%eax)
  return 0;
801054e7:	31 c0                	xor    %eax,%eax
}
801054e9:	5b                   	pop    %ebx
801054ea:	5e                   	pop    %esi
801054eb:	5d                   	pop    %ebp
801054ec:	c3                   	ret    
801054ed:	8d 76 00             	lea    0x0(%esi),%esi
    return -1;
801054f0:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
801054f5:	eb f2                	jmp    801054e9 <argint+0x39>
801054f7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801054fe:	66 90                	xchg   %ax,%ax

80105500 <argptr>:
// Fetch the nth word-sized system call argument as a pointer
// to a block of memory of size bytes.  Check that the pointer
// lies within the process address space.
int
argptr(int n, char **pp, int size)
{
80105500:	f3 0f 1e fb          	endbr32 
80105504:	55                   	push   %ebp
80105505:	89 e5                	mov    %esp,%ebp
80105507:	56                   	push   %esi
80105508:	53                   	push   %ebx
80105509:	83 ec 10             	sub    $0x10,%esp
8010550c:	8b 5d 10             	mov    0x10(%ebp),%ebx
  int i;
  struct proc *curproc = myproc();
8010550f:	e8 2c e4 ff ff       	call   80103940 <myproc>
 
  if(argint(n, &i) < 0)
80105514:	83 ec 08             	sub    $0x8,%esp
  struct proc *curproc = myproc();
80105517:	89 c6                	mov    %eax,%esi
  if(argint(n, &i) < 0)
80105519:	8d 45 f4             	lea    -0xc(%ebp),%eax
8010551c:	50                   	push   %eax
8010551d:	ff 75 08             	pushl  0x8(%ebp)
80105520:	e8 8b ff ff ff       	call   801054b0 <argint>
    return -1;
  if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz)
80105525:	83 c4 10             	add    $0x10,%esp
80105528:	85 c0                	test   %eax,%eax
8010552a:	78 24                	js     80105550 <argptr+0x50>
8010552c:	85 db                	test   %ebx,%ebx
8010552e:	78 20                	js     80105550 <argptr+0x50>
80105530:	8b 16                	mov    (%esi),%edx
80105532:	8b 45 f4             	mov    -0xc(%ebp),%eax
80105535:	39 c2                	cmp    %eax,%edx
80105537:	76 17                	jbe    80105550 <argptr+0x50>
80105539:	01 c3                	add    %eax,%ebx
8010553b:	39 da                	cmp    %ebx,%edx
8010553d:	72 11                	jb     80105550 <argptr+0x50>
    return -1;
  *pp = (char*)i;
8010553f:	8b 55 0c             	mov    0xc(%ebp),%edx
80105542:	89 02                	mov    %eax,(%edx)
  return 0;
80105544:	31 c0                	xor    %eax,%eax
}
80105546:	8d 65 f8             	lea    -0x8(%ebp),%esp
80105549:	5b                   	pop    %ebx
8010554a:	5e                   	pop    %esi
8010554b:	5d                   	pop    %ebp
8010554c:	c3                   	ret    
8010554d:	8d 76 00             	lea    0x0(%esi),%esi
    return -1;
80105550:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105555:	eb ef                	jmp    80105546 <argptr+0x46>
80105557:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010555e:	66 90                	xchg   %ax,%ax

80105560 <argstr>:
// Check that the pointer is valid and the string is nul-terminated.
// (There is no shared writable memory, so the string can't change
// between this check and being used by the kernel.)
int
argstr(int n, char **pp)
{
80105560:	f3 0f 1e fb          	endbr32 
80105564:	55                   	push   %ebp
80105565:	89 e5                	mov    %esp,%ebp
80105567:	83 ec 20             	sub    $0x20,%esp
  int addr;
  if(argint(n, &addr) < 0)
8010556a:	8d 45 f4             	lea    -0xc(%ebp),%eax
8010556d:	50                   	push   %eax
8010556e:	ff 75 08             	pushl  0x8(%ebp)
80105571:	e8 3a ff ff ff       	call   801054b0 <argint>
80105576:	83 c4 10             	add    $0x10,%esp
80105579:	85 c0                	test   %eax,%eax
8010557b:	78 13                	js     80105590 <argstr+0x30>
    return -1;
  return fetchstr(addr, pp);
8010557d:	83 ec 08             	sub    $0x8,%esp
80105580:	ff 75 0c             	pushl  0xc(%ebp)
80105583:	ff 75 f4             	pushl  -0xc(%ebp)
80105586:	e8 c5 fe ff ff       	call   80105450 <fetchstr>
8010558b:	83 c4 10             	add    $0x10,%esp
}
8010558e:	c9                   	leave  
8010558f:	c3                   	ret    
80105590:	c9                   	leave  
    return -1;
80105591:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80105596:	c3                   	ret    
80105597:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010559e:	66 90                	xchg   %ax,%ax

801055a0 <syscall>:
[SYS_setcredit] sys_setcredit,
};

void
syscall(void)
{
801055a0:	f3 0f 1e fb          	endbr32 
801055a4:	55                   	push   %ebp
801055a5:	89 e5                	mov    %esp,%ebp
801055a7:	53                   	push   %ebx
801055a8:	83 ec 04             	sub    $0x4,%esp
  int num;
  struct proc *curproc = myproc();
801055ab:	e8 90 e3 ff ff       	call   80103940 <myproc>
801055b0:	89 c3                	mov    %eax,%ebx

  num = curproc->tf->eax;
801055b2:	8b 40 18             	mov    0x18(%eax),%eax
801055b5:	8b 40 1c             	mov    0x1c(%eax),%eax
  if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
801055b8:	8d 50 ff             	lea    -0x1(%eax),%edx
801055bb:	83 fa 18             	cmp    $0x18,%edx
801055be:	77 20                	ja     801055e0 <syscall+0x40>
801055c0:	8b 14 85 40 7a 10 80 	mov    -0x7fef85c0(,%eax,4),%edx
801055c7:	85 d2                	test   %edx,%edx
801055c9:	74 15                	je     801055e0 <syscall+0x40>
    curproc->tf->eax = syscalls[num]();
801055cb:	ff d2                	call   *%edx
801055cd:	89 c2                	mov    %eax,%edx
801055cf:	8b 43 18             	mov    0x18(%ebx),%eax
801055d2:	89 50 1c             	mov    %edx,0x1c(%eax)
  } else {
    cprintf("%d %s: unknown sys call %d\n",
            curproc->pid, curproc->name, num);
    curproc->tf->eax = -1;
  }
}
801055d5:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801055d8:	c9                   	leave  
801055d9:	c3                   	ret    
801055da:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    cprintf("%d %s: unknown sys call %d\n",
801055e0:	50                   	push   %eax
            curproc->pid, curproc->name, num);
801055e1:	8d 43 6c             	lea    0x6c(%ebx),%eax
    cprintf("%d %s: unknown sys call %d\n",
801055e4:	50                   	push   %eax
801055e5:	ff 73 10             	pushl  0x10(%ebx)
801055e8:	68 08 7a 10 80       	push   $0x80107a08
801055ed:	e8 ee c6 ff ff       	call   80101ce0 <cprintf>
    curproc->tf->eax = -1;
801055f2:	8b 43 18             	mov    0x18(%ebx),%eax
801055f5:	83 c4 10             	add    $0x10,%esp
801055f8:	c7 40 1c ff ff ff ff 	movl   $0xffffffff,0x1c(%eax)
}
801055ff:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80105602:	c9                   	leave  
80105603:	c3                   	ret    
80105604:	66 90                	xchg   %ax,%ax
80105606:	66 90                	xchg   %ax,%ax
80105608:	66 90                	xchg   %ax,%ax
8010560a:	66 90                	xchg   %ax,%ax
8010560c:	66 90                	xchg   %ax,%ax
8010560e:	66 90                	xchg   %ax,%ax

80105610 <create>:
  return -1;
}

static struct inode*
create(char *path, short type, short major, short minor)
{
80105610:	55                   	push   %ebp
80105611:	89 e5                	mov    %esp,%ebp
80105613:	57                   	push   %edi
80105614:	56                   	push   %esi
  struct inode *ip, *dp;
  char name[DIRSIZ];

  if((dp = nameiparent(path, name)) == 0)
80105615:	8d 7d da             	lea    -0x26(%ebp),%edi
{
80105618:	53                   	push   %ebx
80105619:	83 ec 34             	sub    $0x34,%esp
8010561c:	89 4d d0             	mov    %ecx,-0x30(%ebp)
8010561f:	8b 4d 08             	mov    0x8(%ebp),%ecx
  if((dp = nameiparent(path, name)) == 0)
80105622:	57                   	push   %edi
80105623:	50                   	push   %eax
{
80105624:	89 55 d4             	mov    %edx,-0x2c(%ebp)
80105627:	89 4d cc             	mov    %ecx,-0x34(%ebp)
  if((dp = nameiparent(path, name)) == 0)
8010562a:	e8 b1 db ff ff       	call   801031e0 <nameiparent>
8010562f:	83 c4 10             	add    $0x10,%esp
80105632:	85 c0                	test   %eax,%eax
80105634:	0f 84 46 01 00 00    	je     80105780 <create+0x170>
    return 0;
  ilock(dp);
8010563a:	83 ec 0c             	sub    $0xc,%esp
8010563d:	89 c3                	mov    %eax,%ebx
8010563f:	50                   	push   %eax
80105640:	e8 ab d2 ff ff       	call   801028f0 <ilock>

  if((ip = dirlookup(dp, name, 0)) != 0){
80105645:	83 c4 0c             	add    $0xc,%esp
80105648:	6a 00                	push   $0x0
8010564a:	57                   	push   %edi
8010564b:	53                   	push   %ebx
8010564c:	e8 ef d7 ff ff       	call   80102e40 <dirlookup>
80105651:	83 c4 10             	add    $0x10,%esp
80105654:	89 c6                	mov    %eax,%esi
80105656:	85 c0                	test   %eax,%eax
80105658:	74 56                	je     801056b0 <create+0xa0>
    iunlockput(dp);
8010565a:	83 ec 0c             	sub    $0xc,%esp
8010565d:	53                   	push   %ebx
8010565e:	e8 2d d5 ff ff       	call   80102b90 <iunlockput>
    ilock(ip);
80105663:	89 34 24             	mov    %esi,(%esp)
80105666:	e8 85 d2 ff ff       	call   801028f0 <ilock>
    if(type == T_FILE && ip->type == T_FILE)
8010566b:	83 c4 10             	add    $0x10,%esp
8010566e:	66 83 7d d4 02       	cmpw   $0x2,-0x2c(%ebp)
80105673:	75 1b                	jne    80105690 <create+0x80>
80105675:	66 83 7e 50 02       	cmpw   $0x2,0x50(%esi)
8010567a:	75 14                	jne    80105690 <create+0x80>
    panic("create: dirlink");

  iunlockput(dp);

  return ip;
}
8010567c:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010567f:	89 f0                	mov    %esi,%eax
80105681:	5b                   	pop    %ebx
80105682:	5e                   	pop    %esi
80105683:	5f                   	pop    %edi
80105684:	5d                   	pop    %ebp
80105685:	c3                   	ret    
80105686:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010568d:	8d 76 00             	lea    0x0(%esi),%esi
    iunlockput(ip);
80105690:	83 ec 0c             	sub    $0xc,%esp
80105693:	56                   	push   %esi
    return 0;
80105694:	31 f6                	xor    %esi,%esi
    iunlockput(ip);
80105696:	e8 f5 d4 ff ff       	call   80102b90 <iunlockput>
    return 0;
8010569b:	83 c4 10             	add    $0x10,%esp
}
8010569e:	8d 65 f4             	lea    -0xc(%ebp),%esp
801056a1:	89 f0                	mov    %esi,%eax
801056a3:	5b                   	pop    %ebx
801056a4:	5e                   	pop    %esi
801056a5:	5f                   	pop    %edi
801056a6:	5d                   	pop    %ebp
801056a7:	c3                   	ret    
801056a8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801056af:	90                   	nop
  if((ip = ialloc(dp->dev, type)) == 0)
801056b0:	0f bf 45 d4          	movswl -0x2c(%ebp),%eax
801056b4:	83 ec 08             	sub    $0x8,%esp
801056b7:	50                   	push   %eax
801056b8:	ff 33                	pushl  (%ebx)
801056ba:	e8 b1 d0 ff ff       	call   80102770 <ialloc>
801056bf:	83 c4 10             	add    $0x10,%esp
801056c2:	89 c6                	mov    %eax,%esi
801056c4:	85 c0                	test   %eax,%eax
801056c6:	0f 84 cd 00 00 00    	je     80105799 <create+0x189>
  ilock(ip);
801056cc:	83 ec 0c             	sub    $0xc,%esp
801056cf:	50                   	push   %eax
801056d0:	e8 1b d2 ff ff       	call   801028f0 <ilock>
  ip->major = major;
801056d5:	0f b7 45 d0          	movzwl -0x30(%ebp),%eax
801056d9:	66 89 46 52          	mov    %ax,0x52(%esi)
  ip->minor = minor;
801056dd:	0f b7 45 cc          	movzwl -0x34(%ebp),%eax
801056e1:	66 89 46 54          	mov    %ax,0x54(%esi)
  ip->nlink = 1;
801056e5:	b8 01 00 00 00       	mov    $0x1,%eax
801056ea:	66 89 46 56          	mov    %ax,0x56(%esi)
  iupdate(ip);
801056ee:	89 34 24             	mov    %esi,(%esp)
801056f1:	e8 3a d1 ff ff       	call   80102830 <iupdate>
  if(type == T_DIR){  // Create . and .. entries.
801056f6:	83 c4 10             	add    $0x10,%esp
801056f9:	66 83 7d d4 01       	cmpw   $0x1,-0x2c(%ebp)
801056fe:	74 30                	je     80105730 <create+0x120>
  if(dirlink(dp, name, ip->inum) < 0)
80105700:	83 ec 04             	sub    $0x4,%esp
80105703:	ff 76 04             	pushl  0x4(%esi)
80105706:	57                   	push   %edi
80105707:	53                   	push   %ebx
80105708:	e8 f3 d9 ff ff       	call   80103100 <dirlink>
8010570d:	83 c4 10             	add    $0x10,%esp
80105710:	85 c0                	test   %eax,%eax
80105712:	78 78                	js     8010578c <create+0x17c>
  iunlockput(dp);
80105714:	83 ec 0c             	sub    $0xc,%esp
80105717:	53                   	push   %ebx
80105718:	e8 73 d4 ff ff       	call   80102b90 <iunlockput>
  return ip;
8010571d:	83 c4 10             	add    $0x10,%esp
}
80105720:	8d 65 f4             	lea    -0xc(%ebp),%esp
80105723:	89 f0                	mov    %esi,%eax
80105725:	5b                   	pop    %ebx
80105726:	5e                   	pop    %esi
80105727:	5f                   	pop    %edi
80105728:	5d                   	pop    %ebp
80105729:	c3                   	ret    
8010572a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    iupdate(dp);
80105730:	83 ec 0c             	sub    $0xc,%esp
    dp->nlink++;  // for ".."
80105733:	66 83 43 56 01       	addw   $0x1,0x56(%ebx)
    iupdate(dp);
80105738:	53                   	push   %ebx
80105739:	e8 f2 d0 ff ff       	call   80102830 <iupdate>
    if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0)
8010573e:	83 c4 0c             	add    $0xc,%esp
80105741:	ff 76 04             	pushl  0x4(%esi)
80105744:	68 c4 7a 10 80       	push   $0x80107ac4
80105749:	56                   	push   %esi
8010574a:	e8 b1 d9 ff ff       	call   80103100 <dirlink>
8010574f:	83 c4 10             	add    $0x10,%esp
80105752:	85 c0                	test   %eax,%eax
80105754:	78 18                	js     8010576e <create+0x15e>
80105756:	83 ec 04             	sub    $0x4,%esp
80105759:	ff 73 04             	pushl  0x4(%ebx)
8010575c:	68 c3 7a 10 80       	push   $0x80107ac3
80105761:	56                   	push   %esi
80105762:	e8 99 d9 ff ff       	call   80103100 <dirlink>
80105767:	83 c4 10             	add    $0x10,%esp
8010576a:	85 c0                	test   %eax,%eax
8010576c:	79 92                	jns    80105700 <create+0xf0>
      panic("create dots");
8010576e:	83 ec 0c             	sub    $0xc,%esp
80105771:	68 b7 7a 10 80       	push   $0x80107ab7
80105776:	e8 45 c2 ff ff       	call   801019c0 <panic>
8010577b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010577f:	90                   	nop
}
80105780:	8d 65 f4             	lea    -0xc(%ebp),%esp
    return 0;
80105783:	31 f6                	xor    %esi,%esi
}
80105785:	5b                   	pop    %ebx
80105786:	89 f0                	mov    %esi,%eax
80105788:	5e                   	pop    %esi
80105789:	5f                   	pop    %edi
8010578a:	5d                   	pop    %ebp
8010578b:	c3                   	ret    
    panic("create: dirlink");
8010578c:	83 ec 0c             	sub    $0xc,%esp
8010578f:	68 c6 7a 10 80       	push   $0x80107ac6
80105794:	e8 27 c2 ff ff       	call   801019c0 <panic>
    panic("create: ialloc");
80105799:	83 ec 0c             	sub    $0xc,%esp
8010579c:	68 a8 7a 10 80       	push   $0x80107aa8
801057a1:	e8 1a c2 ff ff       	call   801019c0 <panic>
801057a6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801057ad:	8d 76 00             	lea    0x0(%esi),%esi

801057b0 <argfd.constprop.0>:
argfd(int n, int *pfd, struct file **pf)
801057b0:	55                   	push   %ebp
801057b1:	89 e5                	mov    %esp,%ebp
801057b3:	56                   	push   %esi
801057b4:	89 d6                	mov    %edx,%esi
801057b6:	53                   	push   %ebx
801057b7:	89 c3                	mov    %eax,%ebx
  if(argint(n, &fd) < 0)
801057b9:	8d 45 f4             	lea    -0xc(%ebp),%eax
argfd(int n, int *pfd, struct file **pf)
801057bc:	83 ec 18             	sub    $0x18,%esp
  if(argint(n, &fd) < 0)
801057bf:	50                   	push   %eax
801057c0:	6a 00                	push   $0x0
801057c2:	e8 e9 fc ff ff       	call   801054b0 <argint>
801057c7:	83 c4 10             	add    $0x10,%esp
801057ca:	85 c0                	test   %eax,%eax
801057cc:	78 2a                	js     801057f8 <argfd.constprop.0+0x48>
  if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0)
801057ce:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
801057d2:	77 24                	ja     801057f8 <argfd.constprop.0+0x48>
801057d4:	e8 67 e1 ff ff       	call   80103940 <myproc>
801057d9:	8b 55 f4             	mov    -0xc(%ebp),%edx
801057dc:	8b 44 90 28          	mov    0x28(%eax,%edx,4),%eax
801057e0:	85 c0                	test   %eax,%eax
801057e2:	74 14                	je     801057f8 <argfd.constprop.0+0x48>
  if(pfd)
801057e4:	85 db                	test   %ebx,%ebx
801057e6:	74 02                	je     801057ea <argfd.constprop.0+0x3a>
    *pfd = fd;
801057e8:	89 13                	mov    %edx,(%ebx)
    *pf = f;
801057ea:	89 06                	mov    %eax,(%esi)
  return 0;
801057ec:	31 c0                	xor    %eax,%eax
}
801057ee:	8d 65 f8             	lea    -0x8(%ebp),%esp
801057f1:	5b                   	pop    %ebx
801057f2:	5e                   	pop    %esi
801057f3:	5d                   	pop    %ebp
801057f4:	c3                   	ret    
801057f5:	8d 76 00             	lea    0x0(%esi),%esi
    return -1;
801057f8:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
801057fd:	eb ef                	jmp    801057ee <argfd.constprop.0+0x3e>
801057ff:	90                   	nop

80105800 <sys_dup>:
{
80105800:	f3 0f 1e fb          	endbr32 
80105804:	55                   	push   %ebp
  if(argfd(0, 0, &f) < 0)
80105805:	31 c0                	xor    %eax,%eax
{
80105807:	89 e5                	mov    %esp,%ebp
80105809:	56                   	push   %esi
8010580a:	53                   	push   %ebx
  if(argfd(0, 0, &f) < 0)
8010580b:	8d 55 f4             	lea    -0xc(%ebp),%edx
{
8010580e:	83 ec 10             	sub    $0x10,%esp
  if(argfd(0, 0, &f) < 0)
80105811:	e8 9a ff ff ff       	call   801057b0 <argfd.constprop.0>
80105816:	85 c0                	test   %eax,%eax
80105818:	78 1e                	js     80105838 <sys_dup+0x38>
  if((fd=fdalloc(f)) < 0)
8010581a:	8b 75 f4             	mov    -0xc(%ebp),%esi
  for(fd = 0; fd < NOFILE; fd++){
8010581d:	31 db                	xor    %ebx,%ebx
  struct proc *curproc = myproc();
8010581f:	e8 1c e1 ff ff       	call   80103940 <myproc>
  for(fd = 0; fd < NOFILE; fd++){
80105824:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    if(curproc->ofile[fd] == 0){
80105828:	8b 54 98 28          	mov    0x28(%eax,%ebx,4),%edx
8010582c:	85 d2                	test   %edx,%edx
8010582e:	74 20                	je     80105850 <sys_dup+0x50>
  for(fd = 0; fd < NOFILE; fd++){
80105830:	83 c3 01             	add    $0x1,%ebx
80105833:	83 fb 10             	cmp    $0x10,%ebx
80105836:	75 f0                	jne    80105828 <sys_dup+0x28>
}
80105838:	8d 65 f8             	lea    -0x8(%ebp),%esp
    return -1;
8010583b:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
}
80105840:	89 d8                	mov    %ebx,%eax
80105842:	5b                   	pop    %ebx
80105843:	5e                   	pop    %esi
80105844:	5d                   	pop    %ebp
80105845:	c3                   	ret    
80105846:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010584d:	8d 76 00             	lea    0x0(%esi),%esi
      curproc->ofile[fd] = f;
80105850:	89 74 98 28          	mov    %esi,0x28(%eax,%ebx,4)
  filedup(f);
80105854:	83 ec 0c             	sub    $0xc,%esp
80105857:	ff 75 f4             	pushl  -0xc(%ebp)
8010585a:	e8 81 b9 ff ff       	call   801011e0 <filedup>
  return fd;
8010585f:	83 c4 10             	add    $0x10,%esp
}
80105862:	8d 65 f8             	lea    -0x8(%ebp),%esp
80105865:	89 d8                	mov    %ebx,%eax
80105867:	5b                   	pop    %ebx
80105868:	5e                   	pop    %esi
80105869:	5d                   	pop    %ebp
8010586a:	c3                   	ret    
8010586b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010586f:	90                   	nop

80105870 <sys_read>:
{
80105870:	f3 0f 1e fb          	endbr32 
80105874:	55                   	push   %ebp
  if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80105875:	31 c0                	xor    %eax,%eax
{
80105877:	89 e5                	mov    %esp,%ebp
80105879:	83 ec 18             	sub    $0x18,%esp
  if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
8010587c:	8d 55 ec             	lea    -0x14(%ebp),%edx
8010587f:	e8 2c ff ff ff       	call   801057b0 <argfd.constprop.0>
80105884:	85 c0                	test   %eax,%eax
80105886:	78 48                	js     801058d0 <sys_read+0x60>
80105888:	83 ec 08             	sub    $0x8,%esp
8010588b:	8d 45 f0             	lea    -0x10(%ebp),%eax
8010588e:	50                   	push   %eax
8010588f:	6a 02                	push   $0x2
80105891:	e8 1a fc ff ff       	call   801054b0 <argint>
80105896:	83 c4 10             	add    $0x10,%esp
80105899:	85 c0                	test   %eax,%eax
8010589b:	78 33                	js     801058d0 <sys_read+0x60>
8010589d:	83 ec 04             	sub    $0x4,%esp
801058a0:	8d 45 f4             	lea    -0xc(%ebp),%eax
801058a3:	ff 75 f0             	pushl  -0x10(%ebp)
801058a6:	50                   	push   %eax
801058a7:	6a 01                	push   $0x1
801058a9:	e8 52 fc ff ff       	call   80105500 <argptr>
801058ae:	83 c4 10             	add    $0x10,%esp
801058b1:	85 c0                	test   %eax,%eax
801058b3:	78 1b                	js     801058d0 <sys_read+0x60>
  return fileread(f, p, n);
801058b5:	83 ec 04             	sub    $0x4,%esp
801058b8:	ff 75 f0             	pushl  -0x10(%ebp)
801058bb:	ff 75 f4             	pushl  -0xc(%ebp)
801058be:	ff 75 ec             	pushl  -0x14(%ebp)
801058c1:	e8 9a ba ff ff       	call   80101360 <fileread>
801058c6:	83 c4 10             	add    $0x10,%esp
}
801058c9:	c9                   	leave  
801058ca:	c3                   	ret    
801058cb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801058cf:	90                   	nop
801058d0:	c9                   	leave  
    return -1;
801058d1:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
801058d6:	c3                   	ret    
801058d7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801058de:	66 90                	xchg   %ax,%ax

801058e0 <sys_write>:
{
801058e0:	f3 0f 1e fb          	endbr32 
801058e4:	55                   	push   %ebp
  if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
801058e5:	31 c0                	xor    %eax,%eax
{
801058e7:	89 e5                	mov    %esp,%ebp
801058e9:	83 ec 18             	sub    $0x18,%esp
  if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
801058ec:	8d 55 ec             	lea    -0x14(%ebp),%edx
801058ef:	e8 bc fe ff ff       	call   801057b0 <argfd.constprop.0>
801058f4:	85 c0                	test   %eax,%eax
801058f6:	78 48                	js     80105940 <sys_write+0x60>
801058f8:	83 ec 08             	sub    $0x8,%esp
801058fb:	8d 45 f0             	lea    -0x10(%ebp),%eax
801058fe:	50                   	push   %eax
801058ff:	6a 02                	push   $0x2
80105901:	e8 aa fb ff ff       	call   801054b0 <argint>
80105906:	83 c4 10             	add    $0x10,%esp
80105909:	85 c0                	test   %eax,%eax
8010590b:	78 33                	js     80105940 <sys_write+0x60>
8010590d:	83 ec 04             	sub    $0x4,%esp
80105910:	8d 45 f4             	lea    -0xc(%ebp),%eax
80105913:	ff 75 f0             	pushl  -0x10(%ebp)
80105916:	50                   	push   %eax
80105917:	6a 01                	push   $0x1
80105919:	e8 e2 fb ff ff       	call   80105500 <argptr>
8010591e:	83 c4 10             	add    $0x10,%esp
80105921:	85 c0                	test   %eax,%eax
80105923:	78 1b                	js     80105940 <sys_write+0x60>
  return filewrite(f, p, n);
80105925:	83 ec 04             	sub    $0x4,%esp
80105928:	ff 75 f0             	pushl  -0x10(%ebp)
8010592b:	ff 75 f4             	pushl  -0xc(%ebp)
8010592e:	ff 75 ec             	pushl  -0x14(%ebp)
80105931:	e8 ca ba ff ff       	call   80101400 <filewrite>
80105936:	83 c4 10             	add    $0x10,%esp
}
80105939:	c9                   	leave  
8010593a:	c3                   	ret    
8010593b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010593f:	90                   	nop
80105940:	c9                   	leave  
    return -1;
80105941:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80105946:	c3                   	ret    
80105947:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010594e:	66 90                	xchg   %ax,%ax

80105950 <sys_close>:
{
80105950:	f3 0f 1e fb          	endbr32 
80105954:	55                   	push   %ebp
80105955:	89 e5                	mov    %esp,%ebp
80105957:	83 ec 18             	sub    $0x18,%esp
  if(argfd(0, &fd, &f) < 0)
8010595a:	8d 55 f4             	lea    -0xc(%ebp),%edx
8010595d:	8d 45 f0             	lea    -0x10(%ebp),%eax
80105960:	e8 4b fe ff ff       	call   801057b0 <argfd.constprop.0>
80105965:	85 c0                	test   %eax,%eax
80105967:	78 27                	js     80105990 <sys_close+0x40>
  myproc()->ofile[fd] = 0;
80105969:	e8 d2 df ff ff       	call   80103940 <myproc>
8010596e:	8b 55 f0             	mov    -0x10(%ebp),%edx
  fileclose(f);
80105971:	83 ec 0c             	sub    $0xc,%esp
  myproc()->ofile[fd] = 0;
80105974:	c7 44 90 28 00 00 00 	movl   $0x0,0x28(%eax,%edx,4)
8010597b:	00 
  fileclose(f);
8010597c:	ff 75 f4             	pushl  -0xc(%ebp)
8010597f:	e8 ac b8 ff ff       	call   80101230 <fileclose>
  return 0;
80105984:	83 c4 10             	add    $0x10,%esp
80105987:	31 c0                	xor    %eax,%eax
}
80105989:	c9                   	leave  
8010598a:	c3                   	ret    
8010598b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010598f:	90                   	nop
80105990:	c9                   	leave  
    return -1;
80105991:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80105996:	c3                   	ret    
80105997:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010599e:	66 90                	xchg   %ax,%ax

801059a0 <sys_fstat>:
{
801059a0:	f3 0f 1e fb          	endbr32 
801059a4:	55                   	push   %ebp
  if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
801059a5:	31 c0                	xor    %eax,%eax
{
801059a7:	89 e5                	mov    %esp,%ebp
801059a9:	83 ec 18             	sub    $0x18,%esp
  if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
801059ac:	8d 55 f0             	lea    -0x10(%ebp),%edx
801059af:	e8 fc fd ff ff       	call   801057b0 <argfd.constprop.0>
801059b4:	85 c0                	test   %eax,%eax
801059b6:	78 30                	js     801059e8 <sys_fstat+0x48>
801059b8:	83 ec 04             	sub    $0x4,%esp
801059bb:	8d 45 f4             	lea    -0xc(%ebp),%eax
801059be:	6a 14                	push   $0x14
801059c0:	50                   	push   %eax
801059c1:	6a 01                	push   $0x1
801059c3:	e8 38 fb ff ff       	call   80105500 <argptr>
801059c8:	83 c4 10             	add    $0x10,%esp
801059cb:	85 c0                	test   %eax,%eax
801059cd:	78 19                	js     801059e8 <sys_fstat+0x48>
  return filestat(f, st);
801059cf:	83 ec 08             	sub    $0x8,%esp
801059d2:	ff 75 f4             	pushl  -0xc(%ebp)
801059d5:	ff 75 f0             	pushl  -0x10(%ebp)
801059d8:	e8 33 b9 ff ff       	call   80101310 <filestat>
801059dd:	83 c4 10             	add    $0x10,%esp
}
801059e0:	c9                   	leave  
801059e1:	c3                   	ret    
801059e2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
801059e8:	c9                   	leave  
    return -1;
801059e9:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
801059ee:	c3                   	ret    
801059ef:	90                   	nop

801059f0 <sys_link>:
{
801059f0:	f3 0f 1e fb          	endbr32 
801059f4:	55                   	push   %ebp
801059f5:	89 e5                	mov    %esp,%ebp
801059f7:	57                   	push   %edi
801059f8:	56                   	push   %esi
  if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
801059f9:	8d 45 d4             	lea    -0x2c(%ebp),%eax
{
801059fc:	53                   	push   %ebx
801059fd:	83 ec 34             	sub    $0x34,%esp
  if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
80105a00:	50                   	push   %eax
80105a01:	6a 00                	push   $0x0
80105a03:	e8 58 fb ff ff       	call   80105560 <argstr>
80105a08:	83 c4 10             	add    $0x10,%esp
80105a0b:	85 c0                	test   %eax,%eax
80105a0d:	0f 88 ff 00 00 00    	js     80105b12 <sys_link+0x122>
80105a13:	83 ec 08             	sub    $0x8,%esp
80105a16:	8d 45 d0             	lea    -0x30(%ebp),%eax
80105a19:	50                   	push   %eax
80105a1a:	6a 01                	push   $0x1
80105a1c:	e8 3f fb ff ff       	call   80105560 <argstr>
80105a21:	83 c4 10             	add    $0x10,%esp
80105a24:	85 c0                	test   %eax,%eax
80105a26:	0f 88 e6 00 00 00    	js     80105b12 <sys_link+0x122>
  begin_op();
80105a2c:	e8 6f b4 ff ff       	call   80100ea0 <begin_op>
  if((ip = namei(old)) == 0){
80105a31:	83 ec 0c             	sub    $0xc,%esp
80105a34:	ff 75 d4             	pushl  -0x2c(%ebp)
80105a37:	e8 84 d7 ff ff       	call   801031c0 <namei>
80105a3c:	83 c4 10             	add    $0x10,%esp
80105a3f:	89 c3                	mov    %eax,%ebx
80105a41:	85 c0                	test   %eax,%eax
80105a43:	0f 84 e8 00 00 00    	je     80105b31 <sys_link+0x141>
  ilock(ip);
80105a49:	83 ec 0c             	sub    $0xc,%esp
80105a4c:	50                   	push   %eax
80105a4d:	e8 9e ce ff ff       	call   801028f0 <ilock>
  if(ip->type == T_DIR){
80105a52:	83 c4 10             	add    $0x10,%esp
80105a55:	66 83 7b 50 01       	cmpw   $0x1,0x50(%ebx)
80105a5a:	0f 84 b9 00 00 00    	je     80105b19 <sys_link+0x129>
  iupdate(ip);
80105a60:	83 ec 0c             	sub    $0xc,%esp
  ip->nlink++;
80105a63:	66 83 43 56 01       	addw   $0x1,0x56(%ebx)
  if((dp = nameiparent(new, name)) == 0)
80105a68:	8d 7d da             	lea    -0x26(%ebp),%edi
  iupdate(ip);
80105a6b:	53                   	push   %ebx
80105a6c:	e8 bf cd ff ff       	call   80102830 <iupdate>
  iunlock(ip);
80105a71:	89 1c 24             	mov    %ebx,(%esp)
80105a74:	e8 57 cf ff ff       	call   801029d0 <iunlock>
  if((dp = nameiparent(new, name)) == 0)
80105a79:	58                   	pop    %eax
80105a7a:	5a                   	pop    %edx
80105a7b:	57                   	push   %edi
80105a7c:	ff 75 d0             	pushl  -0x30(%ebp)
80105a7f:	e8 5c d7 ff ff       	call   801031e0 <nameiparent>
80105a84:	83 c4 10             	add    $0x10,%esp
80105a87:	89 c6                	mov    %eax,%esi
80105a89:	85 c0                	test   %eax,%eax
80105a8b:	74 5f                	je     80105aec <sys_link+0xfc>
  ilock(dp);
80105a8d:	83 ec 0c             	sub    $0xc,%esp
80105a90:	50                   	push   %eax
80105a91:	e8 5a ce ff ff       	call   801028f0 <ilock>
  if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){
80105a96:	8b 03                	mov    (%ebx),%eax
80105a98:	83 c4 10             	add    $0x10,%esp
80105a9b:	39 06                	cmp    %eax,(%esi)
80105a9d:	75 41                	jne    80105ae0 <sys_link+0xf0>
80105a9f:	83 ec 04             	sub    $0x4,%esp
80105aa2:	ff 73 04             	pushl  0x4(%ebx)
80105aa5:	57                   	push   %edi
80105aa6:	56                   	push   %esi
80105aa7:	e8 54 d6 ff ff       	call   80103100 <dirlink>
80105aac:	83 c4 10             	add    $0x10,%esp
80105aaf:	85 c0                	test   %eax,%eax
80105ab1:	78 2d                	js     80105ae0 <sys_link+0xf0>
  iunlockput(dp);
80105ab3:	83 ec 0c             	sub    $0xc,%esp
80105ab6:	56                   	push   %esi
80105ab7:	e8 d4 d0 ff ff       	call   80102b90 <iunlockput>
  iput(ip);
80105abc:	89 1c 24             	mov    %ebx,(%esp)
80105abf:	e8 5c cf ff ff       	call   80102a20 <iput>
  end_op();
80105ac4:	e8 47 b4 ff ff       	call   80100f10 <end_op>
  return 0;
80105ac9:	83 c4 10             	add    $0x10,%esp
80105acc:	31 c0                	xor    %eax,%eax
}
80105ace:	8d 65 f4             	lea    -0xc(%ebp),%esp
80105ad1:	5b                   	pop    %ebx
80105ad2:	5e                   	pop    %esi
80105ad3:	5f                   	pop    %edi
80105ad4:	5d                   	pop    %ebp
80105ad5:	c3                   	ret    
80105ad6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105add:	8d 76 00             	lea    0x0(%esi),%esi
    iunlockput(dp);
80105ae0:	83 ec 0c             	sub    $0xc,%esp
80105ae3:	56                   	push   %esi
80105ae4:	e8 a7 d0 ff ff       	call   80102b90 <iunlockput>
    goto bad;
80105ae9:	83 c4 10             	add    $0x10,%esp
  ilock(ip);
80105aec:	83 ec 0c             	sub    $0xc,%esp
80105aef:	53                   	push   %ebx
80105af0:	e8 fb cd ff ff       	call   801028f0 <ilock>
  ip->nlink--;
80105af5:	66 83 6b 56 01       	subw   $0x1,0x56(%ebx)
  iupdate(ip);
80105afa:	89 1c 24             	mov    %ebx,(%esp)
80105afd:	e8 2e cd ff ff       	call   80102830 <iupdate>
  iunlockput(ip);
80105b02:	89 1c 24             	mov    %ebx,(%esp)
80105b05:	e8 86 d0 ff ff       	call   80102b90 <iunlockput>
  end_op();
80105b0a:	e8 01 b4 ff ff       	call   80100f10 <end_op>
  return -1;
80105b0f:	83 c4 10             	add    $0x10,%esp
80105b12:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105b17:	eb b5                	jmp    80105ace <sys_link+0xde>
    iunlockput(ip);
80105b19:	83 ec 0c             	sub    $0xc,%esp
80105b1c:	53                   	push   %ebx
80105b1d:	e8 6e d0 ff ff       	call   80102b90 <iunlockput>
    end_op();
80105b22:	e8 e9 b3 ff ff       	call   80100f10 <end_op>
    return -1;
80105b27:	83 c4 10             	add    $0x10,%esp
80105b2a:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105b2f:	eb 9d                	jmp    80105ace <sys_link+0xde>
    end_op();
80105b31:	e8 da b3 ff ff       	call   80100f10 <end_op>
    return -1;
80105b36:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105b3b:	eb 91                	jmp    80105ace <sys_link+0xde>
80105b3d:	8d 76 00             	lea    0x0(%esi),%esi

80105b40 <sys_unlink>:
{
80105b40:	f3 0f 1e fb          	endbr32 
80105b44:	55                   	push   %ebp
80105b45:	89 e5                	mov    %esp,%ebp
80105b47:	57                   	push   %edi
80105b48:	56                   	push   %esi
  if(argstr(0, &path) < 0)
80105b49:	8d 45 c0             	lea    -0x40(%ebp),%eax
{
80105b4c:	53                   	push   %ebx
80105b4d:	83 ec 54             	sub    $0x54,%esp
  if(argstr(0, &path) < 0)
80105b50:	50                   	push   %eax
80105b51:	6a 00                	push   $0x0
80105b53:	e8 08 fa ff ff       	call   80105560 <argstr>
80105b58:	83 c4 10             	add    $0x10,%esp
80105b5b:	85 c0                	test   %eax,%eax
80105b5d:	0f 88 7d 01 00 00    	js     80105ce0 <sys_unlink+0x1a0>
  begin_op();
80105b63:	e8 38 b3 ff ff       	call   80100ea0 <begin_op>
  if((dp = nameiparent(path, name)) == 0){
80105b68:	8d 5d ca             	lea    -0x36(%ebp),%ebx
80105b6b:	83 ec 08             	sub    $0x8,%esp
80105b6e:	53                   	push   %ebx
80105b6f:	ff 75 c0             	pushl  -0x40(%ebp)
80105b72:	e8 69 d6 ff ff       	call   801031e0 <nameiparent>
80105b77:	83 c4 10             	add    $0x10,%esp
80105b7a:	89 c6                	mov    %eax,%esi
80105b7c:	85 c0                	test   %eax,%eax
80105b7e:	0f 84 66 01 00 00    	je     80105cea <sys_unlink+0x1aa>
  ilock(dp);
80105b84:	83 ec 0c             	sub    $0xc,%esp
80105b87:	50                   	push   %eax
80105b88:	e8 63 cd ff ff       	call   801028f0 <ilock>
  if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0)
80105b8d:	58                   	pop    %eax
80105b8e:	5a                   	pop    %edx
80105b8f:	68 c4 7a 10 80       	push   $0x80107ac4
80105b94:	53                   	push   %ebx
80105b95:	e8 86 d2 ff ff       	call   80102e20 <namecmp>
80105b9a:	83 c4 10             	add    $0x10,%esp
80105b9d:	85 c0                	test   %eax,%eax
80105b9f:	0f 84 03 01 00 00    	je     80105ca8 <sys_unlink+0x168>
80105ba5:	83 ec 08             	sub    $0x8,%esp
80105ba8:	68 c3 7a 10 80       	push   $0x80107ac3
80105bad:	53                   	push   %ebx
80105bae:	e8 6d d2 ff ff       	call   80102e20 <namecmp>
80105bb3:	83 c4 10             	add    $0x10,%esp
80105bb6:	85 c0                	test   %eax,%eax
80105bb8:	0f 84 ea 00 00 00    	je     80105ca8 <sys_unlink+0x168>
  if((ip = dirlookup(dp, name, &off)) == 0)
80105bbe:	83 ec 04             	sub    $0x4,%esp
80105bc1:	8d 45 c4             	lea    -0x3c(%ebp),%eax
80105bc4:	50                   	push   %eax
80105bc5:	53                   	push   %ebx
80105bc6:	56                   	push   %esi
80105bc7:	e8 74 d2 ff ff       	call   80102e40 <dirlookup>
80105bcc:	83 c4 10             	add    $0x10,%esp
80105bcf:	89 c3                	mov    %eax,%ebx
80105bd1:	85 c0                	test   %eax,%eax
80105bd3:	0f 84 cf 00 00 00    	je     80105ca8 <sys_unlink+0x168>
  ilock(ip);
80105bd9:	83 ec 0c             	sub    $0xc,%esp
80105bdc:	50                   	push   %eax
80105bdd:	e8 0e cd ff ff       	call   801028f0 <ilock>
  if(ip->nlink < 1)
80105be2:	83 c4 10             	add    $0x10,%esp
80105be5:	66 83 7b 56 00       	cmpw   $0x0,0x56(%ebx)
80105bea:	0f 8e 23 01 00 00    	jle    80105d13 <sys_unlink+0x1d3>
  if(ip->type == T_DIR && !isdirempty(ip)){
80105bf0:	66 83 7b 50 01       	cmpw   $0x1,0x50(%ebx)
80105bf5:	8d 7d d8             	lea    -0x28(%ebp),%edi
80105bf8:	74 66                	je     80105c60 <sys_unlink+0x120>
  memset(&de, 0, sizeof(de));
80105bfa:	83 ec 04             	sub    $0x4,%esp
80105bfd:	6a 10                	push   $0x10
80105bff:	6a 00                	push   $0x0
80105c01:	57                   	push   %edi
80105c02:	e8 c9 f5 ff ff       	call   801051d0 <memset>
  if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80105c07:	6a 10                	push   $0x10
80105c09:	ff 75 c4             	pushl  -0x3c(%ebp)
80105c0c:	57                   	push   %edi
80105c0d:	56                   	push   %esi
80105c0e:	e8 dd d0 ff ff       	call   80102cf0 <writei>
80105c13:	83 c4 20             	add    $0x20,%esp
80105c16:	83 f8 10             	cmp    $0x10,%eax
80105c19:	0f 85 e7 00 00 00    	jne    80105d06 <sys_unlink+0x1c6>
  if(ip->type == T_DIR){
80105c1f:	66 83 7b 50 01       	cmpw   $0x1,0x50(%ebx)
80105c24:	0f 84 96 00 00 00    	je     80105cc0 <sys_unlink+0x180>
  iunlockput(dp);
80105c2a:	83 ec 0c             	sub    $0xc,%esp
80105c2d:	56                   	push   %esi
80105c2e:	e8 5d cf ff ff       	call   80102b90 <iunlockput>
  ip->nlink--;
80105c33:	66 83 6b 56 01       	subw   $0x1,0x56(%ebx)
  iupdate(ip);
80105c38:	89 1c 24             	mov    %ebx,(%esp)
80105c3b:	e8 f0 cb ff ff       	call   80102830 <iupdate>
  iunlockput(ip);
80105c40:	89 1c 24             	mov    %ebx,(%esp)
80105c43:	e8 48 cf ff ff       	call   80102b90 <iunlockput>
  end_op();
80105c48:	e8 c3 b2 ff ff       	call   80100f10 <end_op>
  return 0;
80105c4d:	83 c4 10             	add    $0x10,%esp
80105c50:	31 c0                	xor    %eax,%eax
}
80105c52:	8d 65 f4             	lea    -0xc(%ebp),%esp
80105c55:	5b                   	pop    %ebx
80105c56:	5e                   	pop    %esi
80105c57:	5f                   	pop    %edi
80105c58:	5d                   	pop    %ebp
80105c59:	c3                   	ret    
80105c5a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){
80105c60:	83 7b 58 20          	cmpl   $0x20,0x58(%ebx)
80105c64:	76 94                	jbe    80105bfa <sys_unlink+0xba>
80105c66:	ba 20 00 00 00       	mov    $0x20,%edx
80105c6b:	eb 0b                	jmp    80105c78 <sys_unlink+0x138>
80105c6d:	8d 76 00             	lea    0x0(%esi),%esi
80105c70:	83 c2 10             	add    $0x10,%edx
80105c73:	39 53 58             	cmp    %edx,0x58(%ebx)
80105c76:	76 82                	jbe    80105bfa <sys_unlink+0xba>
    if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80105c78:	6a 10                	push   $0x10
80105c7a:	52                   	push   %edx
80105c7b:	57                   	push   %edi
80105c7c:	53                   	push   %ebx
80105c7d:	89 55 b4             	mov    %edx,-0x4c(%ebp)
80105c80:	e8 6b cf ff ff       	call   80102bf0 <readi>
80105c85:	83 c4 10             	add    $0x10,%esp
80105c88:	8b 55 b4             	mov    -0x4c(%ebp),%edx
80105c8b:	83 f8 10             	cmp    $0x10,%eax
80105c8e:	75 69                	jne    80105cf9 <sys_unlink+0x1b9>
    if(de.inum != 0)
80105c90:	66 83 7d d8 00       	cmpw   $0x0,-0x28(%ebp)
80105c95:	74 d9                	je     80105c70 <sys_unlink+0x130>
    iunlockput(ip);
80105c97:	83 ec 0c             	sub    $0xc,%esp
80105c9a:	53                   	push   %ebx
80105c9b:	e8 f0 ce ff ff       	call   80102b90 <iunlockput>
    goto bad;
80105ca0:	83 c4 10             	add    $0x10,%esp
80105ca3:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80105ca7:	90                   	nop
  iunlockput(dp);
80105ca8:	83 ec 0c             	sub    $0xc,%esp
80105cab:	56                   	push   %esi
80105cac:	e8 df ce ff ff       	call   80102b90 <iunlockput>
  end_op();
80105cb1:	e8 5a b2 ff ff       	call   80100f10 <end_op>
  return -1;
80105cb6:	83 c4 10             	add    $0x10,%esp
80105cb9:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105cbe:	eb 92                	jmp    80105c52 <sys_unlink+0x112>
    iupdate(dp);
80105cc0:	83 ec 0c             	sub    $0xc,%esp
    dp->nlink--;
80105cc3:	66 83 6e 56 01       	subw   $0x1,0x56(%esi)
    iupdate(dp);
80105cc8:	56                   	push   %esi
80105cc9:	e8 62 cb ff ff       	call   80102830 <iupdate>
80105cce:	83 c4 10             	add    $0x10,%esp
80105cd1:	e9 54 ff ff ff       	jmp    80105c2a <sys_unlink+0xea>
80105cd6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105cdd:	8d 76 00             	lea    0x0(%esi),%esi
    return -1;
80105ce0:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105ce5:	e9 68 ff ff ff       	jmp    80105c52 <sys_unlink+0x112>
    end_op();
80105cea:	e8 21 b2 ff ff       	call   80100f10 <end_op>
    return -1;
80105cef:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105cf4:	e9 59 ff ff ff       	jmp    80105c52 <sys_unlink+0x112>
      panic("isdirempty: readi");
80105cf9:	83 ec 0c             	sub    $0xc,%esp
80105cfc:	68 e8 7a 10 80       	push   $0x80107ae8
80105d01:	e8 ba bc ff ff       	call   801019c0 <panic>
    panic("unlink: writei");
80105d06:	83 ec 0c             	sub    $0xc,%esp
80105d09:	68 fa 7a 10 80       	push   $0x80107afa
80105d0e:	e8 ad bc ff ff       	call   801019c0 <panic>
    panic("unlink: nlink < 1");
80105d13:	83 ec 0c             	sub    $0xc,%esp
80105d16:	68 d6 7a 10 80       	push   $0x80107ad6
80105d1b:	e8 a0 bc ff ff       	call   801019c0 <panic>

80105d20 <sys_open>:

int
sys_open(void)
{
80105d20:	f3 0f 1e fb          	endbr32 
80105d24:	55                   	push   %ebp
80105d25:	89 e5                	mov    %esp,%ebp
80105d27:	57                   	push   %edi
80105d28:	56                   	push   %esi
  char *path;
  int fd, omode;
  struct file *f;
  struct inode *ip;

  if(argstr(0, &path) < 0 || argint(1, &omode) < 0)
80105d29:	8d 45 e0             	lea    -0x20(%ebp),%eax
{
80105d2c:	53                   	push   %ebx
80105d2d:	83 ec 24             	sub    $0x24,%esp
  if(argstr(0, &path) < 0 || argint(1, &omode) < 0)
80105d30:	50                   	push   %eax
80105d31:	6a 00                	push   $0x0
80105d33:	e8 28 f8 ff ff       	call   80105560 <argstr>
80105d38:	83 c4 10             	add    $0x10,%esp
80105d3b:	85 c0                	test   %eax,%eax
80105d3d:	0f 88 8a 00 00 00    	js     80105dcd <sys_open+0xad>
80105d43:	83 ec 08             	sub    $0x8,%esp
80105d46:	8d 45 e4             	lea    -0x1c(%ebp),%eax
80105d49:	50                   	push   %eax
80105d4a:	6a 01                	push   $0x1
80105d4c:	e8 5f f7 ff ff       	call   801054b0 <argint>
80105d51:	83 c4 10             	add    $0x10,%esp
80105d54:	85 c0                	test   %eax,%eax
80105d56:	78 75                	js     80105dcd <sys_open+0xad>
    return -1;

  begin_op();
80105d58:	e8 43 b1 ff ff       	call   80100ea0 <begin_op>

  if(omode & O_CREATE){
80105d5d:	f6 45 e5 02          	testb  $0x2,-0x1b(%ebp)
80105d61:	75 75                	jne    80105dd8 <sys_open+0xb8>
    if(ip == 0){
      end_op();
      return -1;
    }
  } else {
    if((ip = namei(path)) == 0){
80105d63:	83 ec 0c             	sub    $0xc,%esp
80105d66:	ff 75 e0             	pushl  -0x20(%ebp)
80105d69:	e8 52 d4 ff ff       	call   801031c0 <namei>
80105d6e:	83 c4 10             	add    $0x10,%esp
80105d71:	89 c6                	mov    %eax,%esi
80105d73:	85 c0                	test   %eax,%eax
80105d75:	74 7e                	je     80105df5 <sys_open+0xd5>
      end_op();
      return -1;
    }
    ilock(ip);
80105d77:	83 ec 0c             	sub    $0xc,%esp
80105d7a:	50                   	push   %eax
80105d7b:	e8 70 cb ff ff       	call   801028f0 <ilock>
    if(ip->type == T_DIR && omode != O_RDONLY){
80105d80:	83 c4 10             	add    $0x10,%esp
80105d83:	66 83 7e 50 01       	cmpw   $0x1,0x50(%esi)
80105d88:	0f 84 c2 00 00 00    	je     80105e50 <sys_open+0x130>
      end_op();
      return -1;
    }
  }

  if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){
80105d8e:	e8 dd b3 ff ff       	call   80101170 <filealloc>
80105d93:	89 c7                	mov    %eax,%edi
80105d95:	85 c0                	test   %eax,%eax
80105d97:	74 23                	je     80105dbc <sys_open+0x9c>
  struct proc *curproc = myproc();
80105d99:	e8 a2 db ff ff       	call   80103940 <myproc>
  for(fd = 0; fd < NOFILE; fd++){
80105d9e:	31 db                	xor    %ebx,%ebx
    if(curproc->ofile[fd] == 0){
80105da0:	8b 54 98 28          	mov    0x28(%eax,%ebx,4),%edx
80105da4:	85 d2                	test   %edx,%edx
80105da6:	74 60                	je     80105e08 <sys_open+0xe8>
  for(fd = 0; fd < NOFILE; fd++){
80105da8:	83 c3 01             	add    $0x1,%ebx
80105dab:	83 fb 10             	cmp    $0x10,%ebx
80105dae:	75 f0                	jne    80105da0 <sys_open+0x80>
    if(f)
      fileclose(f);
80105db0:	83 ec 0c             	sub    $0xc,%esp
80105db3:	57                   	push   %edi
80105db4:	e8 77 b4 ff ff       	call   80101230 <fileclose>
80105db9:	83 c4 10             	add    $0x10,%esp
    iunlockput(ip);
80105dbc:	83 ec 0c             	sub    $0xc,%esp
80105dbf:	56                   	push   %esi
80105dc0:	e8 cb cd ff ff       	call   80102b90 <iunlockput>
    end_op();
80105dc5:	e8 46 b1 ff ff       	call   80100f10 <end_op>
    return -1;
80105dca:	83 c4 10             	add    $0x10,%esp
80105dcd:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
80105dd2:	eb 6d                	jmp    80105e41 <sys_open+0x121>
80105dd4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    ip = create(path, T_FILE, 0, 0);
80105dd8:	83 ec 0c             	sub    $0xc,%esp
80105ddb:	8b 45 e0             	mov    -0x20(%ebp),%eax
80105dde:	31 c9                	xor    %ecx,%ecx
80105de0:	ba 02 00 00 00       	mov    $0x2,%edx
80105de5:	6a 00                	push   $0x0
80105de7:	e8 24 f8 ff ff       	call   80105610 <create>
    if(ip == 0){
80105dec:	83 c4 10             	add    $0x10,%esp
    ip = create(path, T_FILE, 0, 0);
80105def:	89 c6                	mov    %eax,%esi
    if(ip == 0){
80105df1:	85 c0                	test   %eax,%eax
80105df3:	75 99                	jne    80105d8e <sys_open+0x6e>
      end_op();
80105df5:	e8 16 b1 ff ff       	call   80100f10 <end_op>
      return -1;
80105dfa:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
80105dff:	eb 40                	jmp    80105e41 <sys_open+0x121>
80105e01:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  }
  iunlock(ip);
80105e08:	83 ec 0c             	sub    $0xc,%esp
      curproc->ofile[fd] = f;
80105e0b:	89 7c 98 28          	mov    %edi,0x28(%eax,%ebx,4)
  iunlock(ip);
80105e0f:	56                   	push   %esi
80105e10:	e8 bb cb ff ff       	call   801029d0 <iunlock>
  end_op();
80105e15:	e8 f6 b0 ff ff       	call   80100f10 <end_op>

  f->type = FD_INODE;
80105e1a:	c7 07 02 00 00 00    	movl   $0x2,(%edi)
  f->ip = ip;
  f->off = 0;
  f->readable = !(omode & O_WRONLY);
80105e20:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
80105e23:	83 c4 10             	add    $0x10,%esp
  f->ip = ip;
80105e26:	89 77 10             	mov    %esi,0x10(%edi)
  f->readable = !(omode & O_WRONLY);
80105e29:	89 d0                	mov    %edx,%eax
  f->off = 0;
80105e2b:	c7 47 14 00 00 00 00 	movl   $0x0,0x14(%edi)
  f->readable = !(omode & O_WRONLY);
80105e32:	f7 d0                	not    %eax
80105e34:	83 e0 01             	and    $0x1,%eax
  f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
80105e37:	83 e2 03             	and    $0x3,%edx
  f->readable = !(omode & O_WRONLY);
80105e3a:	88 47 08             	mov    %al,0x8(%edi)
  f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
80105e3d:	0f 95 47 09          	setne  0x9(%edi)
  return fd;
}
80105e41:	8d 65 f4             	lea    -0xc(%ebp),%esp
80105e44:	89 d8                	mov    %ebx,%eax
80105e46:	5b                   	pop    %ebx
80105e47:	5e                   	pop    %esi
80105e48:	5f                   	pop    %edi
80105e49:	5d                   	pop    %ebp
80105e4a:	c3                   	ret    
80105e4b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80105e4f:	90                   	nop
    if(ip->type == T_DIR && omode != O_RDONLY){
80105e50:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
80105e53:	85 c9                	test   %ecx,%ecx
80105e55:	0f 84 33 ff ff ff    	je     80105d8e <sys_open+0x6e>
80105e5b:	e9 5c ff ff ff       	jmp    80105dbc <sys_open+0x9c>

80105e60 <sys_mkdir>:

int
sys_mkdir(void)
{
80105e60:	f3 0f 1e fb          	endbr32 
80105e64:	55                   	push   %ebp
80105e65:	89 e5                	mov    %esp,%ebp
80105e67:	83 ec 18             	sub    $0x18,%esp
  char *path;
  struct inode *ip;

  begin_op();
80105e6a:	e8 31 b0 ff ff       	call   80100ea0 <begin_op>
  if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){
80105e6f:	83 ec 08             	sub    $0x8,%esp
80105e72:	8d 45 f4             	lea    -0xc(%ebp),%eax
80105e75:	50                   	push   %eax
80105e76:	6a 00                	push   $0x0
80105e78:	e8 e3 f6 ff ff       	call   80105560 <argstr>
80105e7d:	83 c4 10             	add    $0x10,%esp
80105e80:	85 c0                	test   %eax,%eax
80105e82:	78 34                	js     80105eb8 <sys_mkdir+0x58>
80105e84:	83 ec 0c             	sub    $0xc,%esp
80105e87:	8b 45 f4             	mov    -0xc(%ebp),%eax
80105e8a:	31 c9                	xor    %ecx,%ecx
80105e8c:	ba 01 00 00 00       	mov    $0x1,%edx
80105e91:	6a 00                	push   $0x0
80105e93:	e8 78 f7 ff ff       	call   80105610 <create>
80105e98:	83 c4 10             	add    $0x10,%esp
80105e9b:	85 c0                	test   %eax,%eax
80105e9d:	74 19                	je     80105eb8 <sys_mkdir+0x58>
    end_op();
    return -1;
  }
  iunlockput(ip);
80105e9f:	83 ec 0c             	sub    $0xc,%esp
80105ea2:	50                   	push   %eax
80105ea3:	e8 e8 cc ff ff       	call   80102b90 <iunlockput>
  end_op();
80105ea8:	e8 63 b0 ff ff       	call   80100f10 <end_op>
  return 0;
80105ead:	83 c4 10             	add    $0x10,%esp
80105eb0:	31 c0                	xor    %eax,%eax
}
80105eb2:	c9                   	leave  
80105eb3:	c3                   	ret    
80105eb4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    end_op();
80105eb8:	e8 53 b0 ff ff       	call   80100f10 <end_op>
    return -1;
80105ebd:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80105ec2:	c9                   	leave  
80105ec3:	c3                   	ret    
80105ec4:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105ecb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80105ecf:	90                   	nop

80105ed0 <sys_mknod>:

int
sys_mknod(void)
{
80105ed0:	f3 0f 1e fb          	endbr32 
80105ed4:	55                   	push   %ebp
80105ed5:	89 e5                	mov    %esp,%ebp
80105ed7:	83 ec 18             	sub    $0x18,%esp
  struct inode *ip;
  char *path;
  int major, minor;

  begin_op();
80105eda:	e8 c1 af ff ff       	call   80100ea0 <begin_op>
  if((argstr(0, &path)) < 0 ||
80105edf:	83 ec 08             	sub    $0x8,%esp
80105ee2:	8d 45 ec             	lea    -0x14(%ebp),%eax
80105ee5:	50                   	push   %eax
80105ee6:	6a 00                	push   $0x0
80105ee8:	e8 73 f6 ff ff       	call   80105560 <argstr>
80105eed:	83 c4 10             	add    $0x10,%esp
80105ef0:	85 c0                	test   %eax,%eax
80105ef2:	78 64                	js     80105f58 <sys_mknod+0x88>
     argint(1, &major) < 0 ||
80105ef4:	83 ec 08             	sub    $0x8,%esp
80105ef7:	8d 45 f0             	lea    -0x10(%ebp),%eax
80105efa:	50                   	push   %eax
80105efb:	6a 01                	push   $0x1
80105efd:	e8 ae f5 ff ff       	call   801054b0 <argint>
  if((argstr(0, &path)) < 0 ||
80105f02:	83 c4 10             	add    $0x10,%esp
80105f05:	85 c0                	test   %eax,%eax
80105f07:	78 4f                	js     80105f58 <sys_mknod+0x88>
     argint(2, &minor) < 0 ||
80105f09:	83 ec 08             	sub    $0x8,%esp
80105f0c:	8d 45 f4             	lea    -0xc(%ebp),%eax
80105f0f:	50                   	push   %eax
80105f10:	6a 02                	push   $0x2
80105f12:	e8 99 f5 ff ff       	call   801054b0 <argint>
     argint(1, &major) < 0 ||
80105f17:	83 c4 10             	add    $0x10,%esp
80105f1a:	85 c0                	test   %eax,%eax
80105f1c:	78 3a                	js     80105f58 <sys_mknod+0x88>
     (ip = create(path, T_DEV, major, minor)) == 0){
80105f1e:	0f bf 45 f4          	movswl -0xc(%ebp),%eax
80105f22:	83 ec 0c             	sub    $0xc,%esp
80105f25:	0f bf 4d f0          	movswl -0x10(%ebp),%ecx
80105f29:	ba 03 00 00 00       	mov    $0x3,%edx
80105f2e:	50                   	push   %eax
80105f2f:	8b 45 ec             	mov    -0x14(%ebp),%eax
80105f32:	e8 d9 f6 ff ff       	call   80105610 <create>
     argint(2, &minor) < 0 ||
80105f37:	83 c4 10             	add    $0x10,%esp
80105f3a:	85 c0                	test   %eax,%eax
80105f3c:	74 1a                	je     80105f58 <sys_mknod+0x88>
    end_op();
    return -1;
  }
  iunlockput(ip);
80105f3e:	83 ec 0c             	sub    $0xc,%esp
80105f41:	50                   	push   %eax
80105f42:	e8 49 cc ff ff       	call   80102b90 <iunlockput>
  end_op();
80105f47:	e8 c4 af ff ff       	call   80100f10 <end_op>
  return 0;
80105f4c:	83 c4 10             	add    $0x10,%esp
80105f4f:	31 c0                	xor    %eax,%eax
}
80105f51:	c9                   	leave  
80105f52:	c3                   	ret    
80105f53:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80105f57:	90                   	nop
    end_op();
80105f58:	e8 b3 af ff ff       	call   80100f10 <end_op>
    return -1;
80105f5d:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80105f62:	c9                   	leave  
80105f63:	c3                   	ret    
80105f64:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105f6b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80105f6f:	90                   	nop

80105f70 <sys_chdir>:

int
sys_chdir(void)
{
80105f70:	f3 0f 1e fb          	endbr32 
80105f74:	55                   	push   %ebp
80105f75:	89 e5                	mov    %esp,%ebp
80105f77:	56                   	push   %esi
80105f78:	53                   	push   %ebx
80105f79:	83 ec 10             	sub    $0x10,%esp
  char *path;
  struct inode *ip;
  struct proc *curproc = myproc();
80105f7c:	e8 bf d9 ff ff       	call   80103940 <myproc>
80105f81:	89 c6                	mov    %eax,%esi
  
  begin_op();
80105f83:	e8 18 af ff ff       	call   80100ea0 <begin_op>
  if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){
80105f88:	83 ec 08             	sub    $0x8,%esp
80105f8b:	8d 45 f4             	lea    -0xc(%ebp),%eax
80105f8e:	50                   	push   %eax
80105f8f:	6a 00                	push   $0x0
80105f91:	e8 ca f5 ff ff       	call   80105560 <argstr>
80105f96:	83 c4 10             	add    $0x10,%esp
80105f99:	85 c0                	test   %eax,%eax
80105f9b:	78 73                	js     80106010 <sys_chdir+0xa0>
80105f9d:	83 ec 0c             	sub    $0xc,%esp
80105fa0:	ff 75 f4             	pushl  -0xc(%ebp)
80105fa3:	e8 18 d2 ff ff       	call   801031c0 <namei>
80105fa8:	83 c4 10             	add    $0x10,%esp
80105fab:	89 c3                	mov    %eax,%ebx
80105fad:	85 c0                	test   %eax,%eax
80105faf:	74 5f                	je     80106010 <sys_chdir+0xa0>
    end_op();
    return -1;
  }
  ilock(ip);
80105fb1:	83 ec 0c             	sub    $0xc,%esp
80105fb4:	50                   	push   %eax
80105fb5:	e8 36 c9 ff ff       	call   801028f0 <ilock>
  if(ip->type != T_DIR){
80105fba:	83 c4 10             	add    $0x10,%esp
80105fbd:	66 83 7b 50 01       	cmpw   $0x1,0x50(%ebx)
80105fc2:	75 2c                	jne    80105ff0 <sys_chdir+0x80>
    iunlockput(ip);
    end_op();
    return -1;
  }
  iunlock(ip);
80105fc4:	83 ec 0c             	sub    $0xc,%esp
80105fc7:	53                   	push   %ebx
80105fc8:	e8 03 ca ff ff       	call   801029d0 <iunlock>
  iput(curproc->cwd);
80105fcd:	58                   	pop    %eax
80105fce:	ff 76 68             	pushl  0x68(%esi)
80105fd1:	e8 4a ca ff ff       	call   80102a20 <iput>
  end_op();
80105fd6:	e8 35 af ff ff       	call   80100f10 <end_op>
  curproc->cwd = ip;
80105fdb:	89 5e 68             	mov    %ebx,0x68(%esi)
  return 0;
80105fde:	83 c4 10             	add    $0x10,%esp
80105fe1:	31 c0                	xor    %eax,%eax
}
80105fe3:	8d 65 f8             	lea    -0x8(%ebp),%esp
80105fe6:	5b                   	pop    %ebx
80105fe7:	5e                   	pop    %esi
80105fe8:	5d                   	pop    %ebp
80105fe9:	c3                   	ret    
80105fea:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    iunlockput(ip);
80105ff0:	83 ec 0c             	sub    $0xc,%esp
80105ff3:	53                   	push   %ebx
80105ff4:	e8 97 cb ff ff       	call   80102b90 <iunlockput>
    end_op();
80105ff9:	e8 12 af ff ff       	call   80100f10 <end_op>
    return -1;
80105ffe:	83 c4 10             	add    $0x10,%esp
80106001:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80106006:	eb db                	jmp    80105fe3 <sys_chdir+0x73>
80106008:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010600f:	90                   	nop
    end_op();
80106010:	e8 fb ae ff ff       	call   80100f10 <end_op>
    return -1;
80106015:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
8010601a:	eb c7                	jmp    80105fe3 <sys_chdir+0x73>
8010601c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80106020 <sys_exec>:

int
sys_exec(void)
{
80106020:	f3 0f 1e fb          	endbr32 
80106024:	55                   	push   %ebp
80106025:	89 e5                	mov    %esp,%ebp
80106027:	57                   	push   %edi
80106028:	56                   	push   %esi
  char *path, *argv[MAXARG];
  int i;
  uint uargv, uarg;

  if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
80106029:	8d 85 5c ff ff ff    	lea    -0xa4(%ebp),%eax
{
8010602f:	53                   	push   %ebx
80106030:	81 ec a4 00 00 00    	sub    $0xa4,%esp
  if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
80106036:	50                   	push   %eax
80106037:	6a 00                	push   $0x0
80106039:	e8 22 f5 ff ff       	call   80105560 <argstr>
8010603e:	83 c4 10             	add    $0x10,%esp
80106041:	85 c0                	test   %eax,%eax
80106043:	0f 88 8b 00 00 00    	js     801060d4 <sys_exec+0xb4>
80106049:	83 ec 08             	sub    $0x8,%esp
8010604c:	8d 85 60 ff ff ff    	lea    -0xa0(%ebp),%eax
80106052:	50                   	push   %eax
80106053:	6a 01                	push   $0x1
80106055:	e8 56 f4 ff ff       	call   801054b0 <argint>
8010605a:	83 c4 10             	add    $0x10,%esp
8010605d:	85 c0                	test   %eax,%eax
8010605f:	78 73                	js     801060d4 <sys_exec+0xb4>
    return -1;
  }
  memset(argv, 0, sizeof(argv));
80106061:	83 ec 04             	sub    $0x4,%esp
80106064:	8d 85 68 ff ff ff    	lea    -0x98(%ebp),%eax
  for(i=0;; i++){
8010606a:	31 db                	xor    %ebx,%ebx
  memset(argv, 0, sizeof(argv));
8010606c:	68 80 00 00 00       	push   $0x80
80106071:	8d bd 64 ff ff ff    	lea    -0x9c(%ebp),%edi
80106077:	6a 00                	push   $0x0
80106079:	50                   	push   %eax
8010607a:	e8 51 f1 ff ff       	call   801051d0 <memset>
8010607f:	83 c4 10             	add    $0x10,%esp
80106082:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    if(i >= NELEM(argv))
      return -1;
    if(fetchint(uargv+4*i, (int*)&uarg) < 0)
80106088:	8b 85 60 ff ff ff    	mov    -0xa0(%ebp),%eax
8010608e:	8d 34 9d 00 00 00 00 	lea    0x0(,%ebx,4),%esi
80106095:	83 ec 08             	sub    $0x8,%esp
80106098:	57                   	push   %edi
80106099:	01 f0                	add    %esi,%eax
8010609b:	50                   	push   %eax
8010609c:	e8 6f f3 ff ff       	call   80105410 <fetchint>
801060a1:	83 c4 10             	add    $0x10,%esp
801060a4:	85 c0                	test   %eax,%eax
801060a6:	78 2c                	js     801060d4 <sys_exec+0xb4>
      return -1;
    if(uarg == 0){
801060a8:	8b 85 64 ff ff ff    	mov    -0x9c(%ebp),%eax
801060ae:	85 c0                	test   %eax,%eax
801060b0:	74 36                	je     801060e8 <sys_exec+0xc8>
      argv[i] = 0;
      break;
    }
    if(fetchstr(uarg, &argv[i]) < 0)
801060b2:	8d 8d 68 ff ff ff    	lea    -0x98(%ebp),%ecx
801060b8:	83 ec 08             	sub    $0x8,%esp
801060bb:	8d 14 31             	lea    (%ecx,%esi,1),%edx
801060be:	52                   	push   %edx
801060bf:	50                   	push   %eax
801060c0:	e8 8b f3 ff ff       	call   80105450 <fetchstr>
801060c5:	83 c4 10             	add    $0x10,%esp
801060c8:	85 c0                	test   %eax,%eax
801060ca:	78 08                	js     801060d4 <sys_exec+0xb4>
  for(i=0;; i++){
801060cc:	83 c3 01             	add    $0x1,%ebx
    if(i >= NELEM(argv))
801060cf:	83 fb 20             	cmp    $0x20,%ebx
801060d2:	75 b4                	jne    80106088 <sys_exec+0x68>
      return -1;
  }
  return exec(path, argv);
}
801060d4:	8d 65 f4             	lea    -0xc(%ebp),%esp
    return -1;
801060d7:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
801060dc:	5b                   	pop    %ebx
801060dd:	5e                   	pop    %esi
801060de:	5f                   	pop    %edi
801060df:	5d                   	pop    %ebp
801060e0:	c3                   	ret    
801060e1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  return exec(path, argv);
801060e8:	83 ec 08             	sub    $0x8,%esp
801060eb:	8d 85 68 ff ff ff    	lea    -0x98(%ebp),%eax
      argv[i] = 0;
801060f1:	c7 84 9d 68 ff ff ff 	movl   $0x0,-0x98(%ebp,%ebx,4)
801060f8:	00 00 00 00 
  return exec(path, argv);
801060fc:	50                   	push   %eax
801060fd:	ff b5 5c ff ff ff    	pushl  -0xa4(%ebp)
80106103:	e8 f8 e1 ff ff       	call   80104300 <exec>
80106108:	83 c4 10             	add    $0x10,%esp
}
8010610b:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010610e:	5b                   	pop    %ebx
8010610f:	5e                   	pop    %esi
80106110:	5f                   	pop    %edi
80106111:	5d                   	pop    %ebp
80106112:	c3                   	ret    
80106113:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010611a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80106120 <sys_pipe>:

int
sys_pipe(void)
{
80106120:	f3 0f 1e fb          	endbr32 
80106124:	55                   	push   %ebp
80106125:	89 e5                	mov    %esp,%ebp
80106127:	57                   	push   %edi
80106128:	56                   	push   %esi
  int *fd;
  struct file *rf, *wf;
  int fd0, fd1;

  if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
80106129:	8d 45 dc             	lea    -0x24(%ebp),%eax
{
8010612c:	53                   	push   %ebx
8010612d:	83 ec 20             	sub    $0x20,%esp
  if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
80106130:	6a 08                	push   $0x8
80106132:	50                   	push   %eax
80106133:	6a 00                	push   $0x0
80106135:	e8 c6 f3 ff ff       	call   80105500 <argptr>
8010613a:	83 c4 10             	add    $0x10,%esp
8010613d:	85 c0                	test   %eax,%eax
8010613f:	78 4e                	js     8010618f <sys_pipe+0x6f>
    return -1;
  if(pipealloc(&rf, &wf) < 0)
80106141:	83 ec 08             	sub    $0x8,%esp
80106144:	8d 45 e4             	lea    -0x1c(%ebp),%eax
80106147:	50                   	push   %eax
80106148:	8d 45 e0             	lea    -0x20(%ebp),%eax
8010614b:	50                   	push   %eax
8010614c:	e8 cf b3 ff ff       	call   80101520 <pipealloc>
80106151:	83 c4 10             	add    $0x10,%esp
80106154:	85 c0                	test   %eax,%eax
80106156:	78 37                	js     8010618f <sys_pipe+0x6f>
    return -1;
  fd0 = -1;
  if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
80106158:	8b 7d e0             	mov    -0x20(%ebp),%edi
  for(fd = 0; fd < NOFILE; fd++){
8010615b:	31 db                	xor    %ebx,%ebx
  struct proc *curproc = myproc();
8010615d:	e8 de d7 ff ff       	call   80103940 <myproc>
  for(fd = 0; fd < NOFILE; fd++){
80106162:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    if(curproc->ofile[fd] == 0){
80106168:	8b 74 98 28          	mov    0x28(%eax,%ebx,4),%esi
8010616c:	85 f6                	test   %esi,%esi
8010616e:	74 30                	je     801061a0 <sys_pipe+0x80>
  for(fd = 0; fd < NOFILE; fd++){
80106170:	83 c3 01             	add    $0x1,%ebx
80106173:	83 fb 10             	cmp    $0x10,%ebx
80106176:	75 f0                	jne    80106168 <sys_pipe+0x48>
    if(fd0 >= 0)
      myproc()->ofile[fd0] = 0;
    fileclose(rf);
80106178:	83 ec 0c             	sub    $0xc,%esp
8010617b:	ff 75 e0             	pushl  -0x20(%ebp)
8010617e:	e8 ad b0 ff ff       	call   80101230 <fileclose>
    fileclose(wf);
80106183:	58                   	pop    %eax
80106184:	ff 75 e4             	pushl  -0x1c(%ebp)
80106187:	e8 a4 b0 ff ff       	call   80101230 <fileclose>
    return -1;
8010618c:	83 c4 10             	add    $0x10,%esp
8010618f:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80106194:	eb 5b                	jmp    801061f1 <sys_pipe+0xd1>
80106196:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010619d:	8d 76 00             	lea    0x0(%esi),%esi
      curproc->ofile[fd] = f;
801061a0:	8d 73 08             	lea    0x8(%ebx),%esi
801061a3:	89 7c b0 08          	mov    %edi,0x8(%eax,%esi,4)
  if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
801061a7:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  struct proc *curproc = myproc();
801061aa:	e8 91 d7 ff ff       	call   80103940 <myproc>
  for(fd = 0; fd < NOFILE; fd++){
801061af:	31 d2                	xor    %edx,%edx
801061b1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    if(curproc->ofile[fd] == 0){
801061b8:	8b 4c 90 28          	mov    0x28(%eax,%edx,4),%ecx
801061bc:	85 c9                	test   %ecx,%ecx
801061be:	74 20                	je     801061e0 <sys_pipe+0xc0>
  for(fd = 0; fd < NOFILE; fd++){
801061c0:	83 c2 01             	add    $0x1,%edx
801061c3:	83 fa 10             	cmp    $0x10,%edx
801061c6:	75 f0                	jne    801061b8 <sys_pipe+0x98>
      myproc()->ofile[fd0] = 0;
801061c8:	e8 73 d7 ff ff       	call   80103940 <myproc>
801061cd:	c7 44 b0 08 00 00 00 	movl   $0x0,0x8(%eax,%esi,4)
801061d4:	00 
801061d5:	eb a1                	jmp    80106178 <sys_pipe+0x58>
801061d7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801061de:	66 90                	xchg   %ax,%ax
      curproc->ofile[fd] = f;
801061e0:	89 7c 90 28          	mov    %edi,0x28(%eax,%edx,4)
  }
  fd[0] = fd0;
801061e4:	8b 45 dc             	mov    -0x24(%ebp),%eax
801061e7:	89 18                	mov    %ebx,(%eax)
  fd[1] = fd1;
801061e9:	8b 45 dc             	mov    -0x24(%ebp),%eax
801061ec:	89 50 04             	mov    %edx,0x4(%eax)
  return 0;
801061ef:	31 c0                	xor    %eax,%eax
}
801061f1:	8d 65 f4             	lea    -0xc(%ebp),%esp
801061f4:	5b                   	pop    %ebx
801061f5:	5e                   	pop    %esi
801061f6:	5f                   	pop    %edi
801061f7:	5d                   	pop    %ebp
801061f8:	c3                   	ret    
801061f9:	66 90                	xchg   %ax,%ax
801061fb:	66 90                	xchg   %ax,%ax
801061fd:	66 90                	xchg   %ax,%ax
801061ff:	90                   	nop

80106200 <sys_fork>:
#include "mmu.h"
#include "proc.h"

int
sys_fork(void)
{
80106200:	f3 0f 1e fb          	endbr32 
  return fork();
80106204:	e9 e7 d8 ff ff       	jmp    80103af0 <fork>
80106209:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80106210 <sys_exit>:
}

int
sys_exit(void)
{
80106210:	f3 0f 1e fb          	endbr32 
80106214:	55                   	push   %ebp
80106215:	89 e5                	mov    %esp,%ebp
80106217:	83 ec 08             	sub    $0x8,%esp
  exit();
8010621a:	e8 b1 db ff ff       	call   80103dd0 <exit>
  return 0;  // not reached
}
8010621f:	31 c0                	xor    %eax,%eax
80106221:	c9                   	leave  
80106222:	c3                   	ret    
80106223:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010622a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80106230 <sys_wait>:

int
sys_wait(void)
{
80106230:	f3 0f 1e fb          	endbr32 
  return wait();
80106234:	e9 e7 dd ff ff       	jmp    80104020 <wait>
80106239:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80106240 <sys_kill>:
}

int
sys_kill(void)
{
80106240:	f3 0f 1e fb          	endbr32 
80106244:	55                   	push   %ebp
80106245:	89 e5                	mov    %esp,%ebp
80106247:	83 ec 20             	sub    $0x20,%esp
  int pid;

  if(argint(0, &pid) < 0)
8010624a:	8d 45 f4             	lea    -0xc(%ebp),%eax
8010624d:	50                   	push   %eax
8010624e:	6a 00                	push   $0x0
80106250:	e8 5b f2 ff ff       	call   801054b0 <argint>
80106255:	83 c4 10             	add    $0x10,%esp
80106258:	85 c0                	test   %eax,%eax
8010625a:	78 14                	js     80106270 <sys_kill+0x30>
    return -1;
  return kill(pid);
8010625c:	83 ec 0c             	sub    $0xc,%esp
8010625f:	ff 75 f4             	pushl  -0xc(%ebp)
80106262:	e8 29 df ff ff       	call   80104190 <kill>
80106267:	83 c4 10             	add    $0x10,%esp
}
8010626a:	c9                   	leave  
8010626b:	c3                   	ret    
8010626c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80106270:	c9                   	leave  
    return -1;
80106271:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80106276:	c3                   	ret    
80106277:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010627e:	66 90                	xchg   %ax,%ax

80106280 <sys_getpid>:

int
sys_getpid(void)
{
80106280:	f3 0f 1e fb          	endbr32 
80106284:	55                   	push   %ebp
80106285:	89 e5                	mov    %esp,%ebp
80106287:	83 ec 08             	sub    $0x8,%esp
  return myproc()->pid;
8010628a:	e8 b1 d6 ff ff       	call   80103940 <myproc>
8010628f:	8b 40 10             	mov    0x10(%eax),%eax
}
80106292:	c9                   	leave  
80106293:	c3                   	ret    
80106294:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010629b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010629f:	90                   	nop

801062a0 <sys_sbrk>:

int
sys_sbrk(void)
{
801062a0:	f3 0f 1e fb          	endbr32 
801062a4:	55                   	push   %ebp
801062a5:	89 e5                	mov    %esp,%ebp
801062a7:	53                   	push   %ebx
  int addr;
  int n;

  if(argint(0, &n) < 0)
801062a8:	8d 45 f4             	lea    -0xc(%ebp),%eax
{
801062ab:	83 ec 1c             	sub    $0x1c,%esp
  if(argint(0, &n) < 0)
801062ae:	50                   	push   %eax
801062af:	6a 00                	push   $0x0
801062b1:	e8 fa f1 ff ff       	call   801054b0 <argint>
801062b6:	83 c4 10             	add    $0x10,%esp
801062b9:	85 c0                	test   %eax,%eax
801062bb:	78 23                	js     801062e0 <sys_sbrk+0x40>
    return -1;
  addr = myproc()->sz;
801062bd:	e8 7e d6 ff ff       	call   80103940 <myproc>
  if(growproc(n) < 0)
801062c2:	83 ec 0c             	sub    $0xc,%esp
  addr = myproc()->sz;
801062c5:	8b 18                	mov    (%eax),%ebx
  if(growproc(n) < 0)
801062c7:	ff 75 f4             	pushl  -0xc(%ebp)
801062ca:	e8 a1 d7 ff ff       	call   80103a70 <growproc>
801062cf:	83 c4 10             	add    $0x10,%esp
801062d2:	85 c0                	test   %eax,%eax
801062d4:	78 0a                	js     801062e0 <sys_sbrk+0x40>
    return -1;
  return addr;
}
801062d6:	89 d8                	mov    %ebx,%eax
801062d8:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801062db:	c9                   	leave  
801062dc:	c3                   	ret    
801062dd:	8d 76 00             	lea    0x0(%esi),%esi
    return -1;
801062e0:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
801062e5:	eb ef                	jmp    801062d6 <sys_sbrk+0x36>
801062e7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801062ee:	66 90                	xchg   %ax,%ax

801062f0 <sys_sleep>:

int
sys_sleep(void)
{
801062f0:	f3 0f 1e fb          	endbr32 
801062f4:	55                   	push   %ebp
801062f5:	89 e5                	mov    %esp,%ebp
801062f7:	53                   	push   %ebx
  int n;
  uint ticks0;

  if(argint(0, &n) < 0)
801062f8:	8d 45 f4             	lea    -0xc(%ebp),%eax
{
801062fb:	83 ec 1c             	sub    $0x1c,%esp
  if(argint(0, &n) < 0)
801062fe:	50                   	push   %eax
801062ff:	6a 00                	push   $0x0
80106301:	e8 aa f1 ff ff       	call   801054b0 <argint>
80106306:	83 c4 10             	add    $0x10,%esp
80106309:	85 c0                	test   %eax,%eax
8010630b:	0f 88 86 00 00 00    	js     80106397 <sys_sleep+0xa7>
    return -1;
  acquire(&tickslock);
80106311:	83 ec 0c             	sub    $0xc,%esp
80106314:	68 a0 41 11 80       	push   $0x801141a0
80106319:	e8 72 a1 ff ff       	call   80100490 <acquire>
  ticks0 = ticks;
  while(ticks - ticks0 < n){
8010631e:	8b 55 f4             	mov    -0xc(%ebp),%edx
  ticks0 = ticks;
80106321:	8b 1d e0 49 11 80    	mov    0x801149e0,%ebx
  while(ticks - ticks0 < n){
80106327:	83 c4 10             	add    $0x10,%esp
8010632a:	85 d2                	test   %edx,%edx
8010632c:	75 23                	jne    80106351 <sys_sleep+0x61>
8010632e:	eb 50                	jmp    80106380 <sys_sleep+0x90>
    if(myproc()->killed){
      release(&tickslock);
      return -1;
    }
    sleep(&ticks, &tickslock);
80106330:	83 ec 08             	sub    $0x8,%esp
80106333:	68 a0 41 11 80       	push   $0x801141a0
80106338:	68 e0 49 11 80       	push   $0x801149e0
8010633d:	e8 1e dc ff ff       	call   80103f60 <sleep>
  while(ticks - ticks0 < n){
80106342:	a1 e0 49 11 80       	mov    0x801149e0,%eax
80106347:	83 c4 10             	add    $0x10,%esp
8010634a:	29 d8                	sub    %ebx,%eax
8010634c:	3b 45 f4             	cmp    -0xc(%ebp),%eax
8010634f:	73 2f                	jae    80106380 <sys_sleep+0x90>
    if(myproc()->killed){
80106351:	e8 ea d5 ff ff       	call   80103940 <myproc>
80106356:	8b 40 24             	mov    0x24(%eax),%eax
80106359:	85 c0                	test   %eax,%eax
8010635b:	74 d3                	je     80106330 <sys_sleep+0x40>
      release(&tickslock);
8010635d:	83 ec 0c             	sub    $0xc,%esp
80106360:	68 a0 41 11 80       	push   $0x801141a0
80106365:	e8 e6 a1 ff ff       	call   80100550 <release>
  }
  release(&tickslock);
  return 0;
}
8010636a:	8b 5d fc             	mov    -0x4(%ebp),%ebx
      return -1;
8010636d:	83 c4 10             	add    $0x10,%esp
80106370:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80106375:	c9                   	leave  
80106376:	c3                   	ret    
80106377:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010637e:	66 90                	xchg   %ax,%ax
  release(&tickslock);
80106380:	83 ec 0c             	sub    $0xc,%esp
80106383:	68 a0 41 11 80       	push   $0x801141a0
80106388:	e8 c3 a1 ff ff       	call   80100550 <release>
  return 0;
8010638d:	83 c4 10             	add    $0x10,%esp
80106390:	31 c0                	xor    %eax,%eax
}
80106392:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80106395:	c9                   	leave  
80106396:	c3                   	ret    
    return -1;
80106397:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
8010639c:	eb f4                	jmp    80106392 <sys_sleep+0xa2>
8010639e:	66 90                	xchg   %ax,%ax

801063a0 <sys_uptime>:

// return how many clock tick interrupts have occurred
// since start.
int
sys_uptime(void)
{
801063a0:	f3 0f 1e fb          	endbr32 
801063a4:	55                   	push   %ebp
801063a5:	89 e5                	mov    %esp,%ebp
801063a7:	53                   	push   %ebx
801063a8:	83 ec 10             	sub    $0x10,%esp
  uint xticks;

  acquire(&tickslock);
801063ab:	68 a0 41 11 80       	push   $0x801141a0
801063b0:	e8 db a0 ff ff       	call   80100490 <acquire>
  xticks = ticks;
801063b5:	8b 1d e0 49 11 80    	mov    0x801149e0,%ebx
  release(&tickslock);
801063bb:	c7 04 24 a0 41 11 80 	movl   $0x801141a0,(%esp)
801063c2:	e8 89 a1 ff ff       	call   80100550 <release>
  return xticks;
}
801063c7:	89 d8                	mov    %ebx,%eax
801063c9:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801063cc:	c9                   	leave  
801063cd:	c3                   	ret    
801063ce:	66 90                	xchg   %ax,%ax

801063d0 <sys_addone>:

int sys_addone(void){
801063d0:	f3 0f 1e fb          	endbr32 
801063d4:	55                   	push   %ebp
801063d5:	89 e5                	mov    %esp,%ebp
801063d7:	83 ec 20             	sub    $0x20,%esp
	int num; 
	argint(0, &num);
801063da:	8d 45 f4             	lea    -0xc(%ebp),%eax
801063dd:	50                   	push   %eax
801063de:	6a 00                	push   $0x0
801063e0:	e8 cb f0 ff ff       	call   801054b0 <argint>
	return num +1; 
801063e5:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
801063e8:	c9                   	leave  
	return num +1; 
801063e9:	83 c0 01             	add    $0x1,%eax
}
801063ec:	c3                   	ret    
801063ed:	8d 76 00             	lea    0x0(%esi),%esi

801063f0 <sys_addtwo>:

int sys_addtwo(void){
801063f0:	f3 0f 1e fb          	endbr32 
801063f4:	55                   	push   %ebp
801063f5:	89 e5                	mov    %esp,%ebp
801063f7:	83 ec 20             	sub    $0x20,%esp
	int num; 
	argint(0,&num);
801063fa:	8d 45 f4             	lea    -0xc(%ebp),%eax
801063fd:	50                   	push   %eax
801063fe:	6a 00                	push   $0x0
80106400:	e8 ab f0 ff ff       	call   801054b0 <argint>
	return num +2;
80106405:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
80106408:	c9                   	leave  
	return num +2;
80106409:	83 c0 02             	add    $0x2,%eax
}
8010640c:	c3                   	ret    
8010640d:	8d 76 00             	lea    0x0(%esi),%esi

80106410 <sys_setticket>:

int sys_setticket(void){
80106410:	f3 0f 1e fb          	endbr32 
80106414:	55                   	push   %ebp
80106415:	89 e5                	mov    %esp,%ebp
80106417:	83 ec 20             	sub    $0x20,%esp
	int n;
	if (argint(0, &n)<0)
8010641a:	8d 45 f4             	lea    -0xc(%ebp),%eax
8010641d:	50                   	push   %eax
8010641e:	6a 00                	push   $0x0
80106420:	e8 8b f0 ff ff       	call   801054b0 <argint>
80106425:	83 c4 10             	add    $0x10,%esp
80106428:	85 c0                	test   %eax,%eax
8010642a:	78 1c                	js     80106448 <sys_setticket+0x38>
		return -1; 
	if (n < 0) return -1; 
8010642c:	8b 45 f4             	mov    -0xc(%ebp),%eax
8010642f:	85 c0                	test   %eax,%eax
80106431:	78 15                	js     80106448 <sys_setticket+0x38>
	struct proc *curproc = myproc();
80106433:	e8 08 d5 ff ff       	call   80103940 <myproc>
	curproc -> ticket = n; 
80106438:	8b 55 f4             	mov    -0xc(%ebp),%edx
8010643b:	89 50 7c             	mov    %edx,0x7c(%eax)
	return 0; 
8010643e:	31 c0                	xor    %eax,%eax
}
80106440:	c9                   	leave  
80106441:	c3                   	ret    
80106442:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80106448:	c9                   	leave  
		return -1; 
80106449:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
8010644e:	c3                   	ret    
8010644f:	90                   	nop

80106450 <sys_setcredit>:


int sys_setcredit(void){
80106450:	f3 0f 1e fb          	endbr32 
80106454:	55                   	push   %ebp
80106455:	89 e5                	mov    %esp,%ebp
80106457:	83 ec 20             	sub    $0x20,%esp
	int credit;
	if (argint(0, &credit)<0)
8010645a:	8d 45 f4             	lea    -0xc(%ebp),%eax
8010645d:	50                   	push   %eax
8010645e:	6a 00                	push   $0x0
80106460:	e8 4b f0 ff ff       	call   801054b0 <argint>
80106465:	83 c4 10             	add    $0x10,%esp
80106468:	85 c0                	test   %eax,%eax
8010646a:	78 14                	js     80106480 <sys_setcredit+0x30>
		return -1; 
	struct proc *curproc = myproc();
8010646c:	e8 cf d4 ff ff       	call   80103940 <myproc>
	curproc -> credit = credit; 
80106471:	8b 55 f4             	mov    -0xc(%ebp),%edx
80106474:	89 90 80 00 00 00    	mov    %edx,0x80(%eax)
	return 0; 
8010647a:	31 c0                	xor    %eax,%eax
}
8010647c:	c9                   	leave  
8010647d:	c3                   	ret    
8010647e:	66 90                	xchg   %ax,%ax
80106480:	c9                   	leave  
		return -1; 
80106481:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80106486:	c3                   	ret    

80106487 <alltraps>:

  # vectors.S sends all traps here.
.globl alltraps
alltraps:
  # Build trap frame.
  pushl %ds
80106487:	1e                   	push   %ds
  pushl %es
80106488:	06                   	push   %es
  pushl %fs
80106489:	0f a0                	push   %fs
  pushl %gs
8010648b:	0f a8                	push   %gs
  pushal
8010648d:	60                   	pusha  
  
  # Set up data segments.
  movw $(SEG_KDATA<<3), %ax
8010648e:	66 b8 10 00          	mov    $0x10,%ax
  movw %ax, %ds
80106492:	8e d8                	mov    %eax,%ds
  movw %ax, %es
80106494:	8e c0                	mov    %eax,%es

  # Call trap(tf), where tf=%esp
  pushl %esp
80106496:	54                   	push   %esp
  call trap
80106497:	e8 c4 00 00 00       	call   80106560 <trap>
  addl $4, %esp
8010649c:	83 c4 04             	add    $0x4,%esp

8010649f <trapret>:

  # Return falls through to trapret...
.globl trapret
trapret:
  popal
8010649f:	61                   	popa   
  popl %gs
801064a0:	0f a9                	pop    %gs
  popl %fs
801064a2:	0f a1                	pop    %fs
  popl %es
801064a4:	07                   	pop    %es
  popl %ds
801064a5:	1f                   	pop    %ds
  addl $0x8, %esp  # trapno and errcode
801064a6:	83 c4 08             	add    $0x8,%esp
  iret
801064a9:	cf                   	iret   
801064aa:	66 90                	xchg   %ax,%ax
801064ac:	66 90                	xchg   %ax,%ax
801064ae:	66 90                	xchg   %ax,%ax

801064b0 <tvinit>:
struct spinlock tickslock;
uint ticks;

void
tvinit(void)
{
801064b0:	f3 0f 1e fb          	endbr32 
801064b4:	55                   	push   %ebp
  int i;

  for(i = 0; i < 256; i++)
801064b5:	31 c0                	xor    %eax,%eax
{
801064b7:	89 e5                	mov    %esp,%ebp
801064b9:	83 ec 08             	sub    $0x8,%esp
801064bc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
801064c0:	8b 14 85 60 93 10 80 	mov    -0x7fef6ca0(,%eax,4),%edx
801064c7:	c7 04 c5 e2 41 11 80 	movl   $0x8e000008,-0x7feebe1e(,%eax,8)
801064ce:	08 00 00 8e 
801064d2:	66 89 14 c5 e0 41 11 	mov    %dx,-0x7feebe20(,%eax,8)
801064d9:	80 
801064da:	c1 ea 10             	shr    $0x10,%edx
801064dd:	66 89 14 c5 e6 41 11 	mov    %dx,-0x7feebe1a(,%eax,8)
801064e4:	80 
  for(i = 0; i < 256; i++)
801064e5:	83 c0 01             	add    $0x1,%eax
801064e8:	3d 00 01 00 00       	cmp    $0x100,%eax
801064ed:	75 d1                	jne    801064c0 <tvinit+0x10>
  SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);

  initlock(&tickslock, "time");
801064ef:	83 ec 08             	sub    $0x8,%esp
  SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
801064f2:	a1 60 94 10 80       	mov    0x80109460,%eax
801064f7:	c7 05 e2 43 11 80 08 	movl   $0xef000008,0x801143e2
801064fe:	00 00 ef 
  initlock(&tickslock, "time");
80106501:	68 09 7b 10 80       	push   $0x80107b09
80106506:	68 a0 41 11 80       	push   $0x801141a0
  SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
8010650b:	66 a3 e0 43 11 80    	mov    %ax,0x801143e0
80106511:	c1 e8 10             	shr    $0x10,%eax
80106514:	66 a3 e6 43 11 80    	mov    %ax,0x801143e6
  initlock(&tickslock, "time");
8010651a:	e8 f1 9d ff ff       	call   80100310 <initlock>
}
8010651f:	83 c4 10             	add    $0x10,%esp
80106522:	c9                   	leave  
80106523:	c3                   	ret    
80106524:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010652b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010652f:	90                   	nop

80106530 <idtinit>:

void
idtinit(void)
{
80106530:	f3 0f 1e fb          	endbr32 
80106534:	55                   	push   %ebp
  pd[0] = size-1;
80106535:	b8 ff 07 00 00       	mov    $0x7ff,%eax
8010653a:	89 e5                	mov    %esp,%ebp
8010653c:	83 ec 10             	sub    $0x10,%esp
8010653f:	66 89 45 fa          	mov    %ax,-0x6(%ebp)
  pd[1] = (uint)p;
80106543:	b8 e0 41 11 80       	mov    $0x801141e0,%eax
80106548:	66 89 45 fc          	mov    %ax,-0x4(%ebp)
  pd[2] = (uint)p >> 16;
8010654c:	c1 e8 10             	shr    $0x10,%eax
8010654f:	66 89 45 fe          	mov    %ax,-0x2(%ebp)
  asm volatile("lidt (%0)" : : "r" (pd));
80106553:	8d 45 fa             	lea    -0x6(%ebp),%eax
80106556:	0f 01 18             	lidtl  (%eax)
  lidt(idt, sizeof(idt));
}
80106559:	c9                   	leave  
8010655a:	c3                   	ret    
8010655b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010655f:	90                   	nop

80106560 <trap>:

//PAGEBREAK: 41
void
trap(struct trapframe *tf)
{
80106560:	f3 0f 1e fb          	endbr32 
80106564:	55                   	push   %ebp
80106565:	89 e5                	mov    %esp,%ebp
80106567:	57                   	push   %edi
80106568:	56                   	push   %esi
80106569:	53                   	push   %ebx
8010656a:	83 ec 1c             	sub    $0x1c,%esp
8010656d:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if(tf->trapno == T_SYSCALL){
80106570:	8b 43 30             	mov    0x30(%ebx),%eax
80106573:	83 f8 40             	cmp    $0x40,%eax
80106576:	0f 84 bc 01 00 00    	je     80106738 <trap+0x1d8>
    if(myproc()->killed)
      exit();
    return;
  }

  switch(tf->trapno){
8010657c:	83 e8 20             	sub    $0x20,%eax
8010657f:	83 f8 1f             	cmp    $0x1f,%eax
80106582:	77 08                	ja     8010658c <trap+0x2c>
80106584:	3e ff 24 85 b0 7b 10 	notrack jmp *-0x7fef8450(,%eax,4)
8010658b:	80 
    lapiceoi();
    break;

  //PAGEBREAK: 13
  default:
    if(myproc() == 0 || (tf->cs&3) == 0){
8010658c:	e8 af d3 ff ff       	call   80103940 <myproc>
80106591:	8b 7b 38             	mov    0x38(%ebx),%edi
80106594:	85 c0                	test   %eax,%eax
80106596:	0f 84 eb 01 00 00    	je     80106787 <trap+0x227>
8010659c:	f6 43 3c 03          	testb  $0x3,0x3c(%ebx)
801065a0:	0f 84 e1 01 00 00    	je     80106787 <trap+0x227>
  asm volatile("movl %%cr2,%0" : "=r" (val));
801065a6:	0f 20 d1             	mov    %cr2,%ecx
801065a9:	89 4d d8             	mov    %ecx,-0x28(%ebp)
      cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
              tf->trapno, cpuid(), tf->eip, rcr2());
      panic("trap");
    }
    // In user space, assume process misbehaved.
    cprintf("pid %d %s: trap %d err %d on cpu %d "
801065ac:	e8 6f d3 ff ff       	call   80103920 <cpuid>
801065b1:	8b 73 30             	mov    0x30(%ebx),%esi
801065b4:	89 45 dc             	mov    %eax,-0x24(%ebp)
801065b7:	8b 43 34             	mov    0x34(%ebx),%eax
801065ba:	89 45 e4             	mov    %eax,-0x1c(%ebp)
            "eip 0x%x addr 0x%x--kill proc\n",
            myproc()->pid, myproc()->name, tf->trapno,
801065bd:	e8 7e d3 ff ff       	call   80103940 <myproc>
801065c2:	89 45 e0             	mov    %eax,-0x20(%ebp)
801065c5:	e8 76 d3 ff ff       	call   80103940 <myproc>
    cprintf("pid %d %s: trap %d err %d on cpu %d "
801065ca:	8b 4d d8             	mov    -0x28(%ebp),%ecx
801065cd:	8b 55 dc             	mov    -0x24(%ebp),%edx
801065d0:	51                   	push   %ecx
801065d1:	57                   	push   %edi
801065d2:	52                   	push   %edx
801065d3:	ff 75 e4             	pushl  -0x1c(%ebp)
801065d6:	56                   	push   %esi
            myproc()->pid, myproc()->name, tf->trapno,
801065d7:	8b 75 e0             	mov    -0x20(%ebp),%esi
801065da:	83 c6 6c             	add    $0x6c,%esi
    cprintf("pid %d %s: trap %d err %d on cpu %d "
801065dd:	56                   	push   %esi
801065de:	ff 70 10             	pushl  0x10(%eax)
801065e1:	68 6c 7b 10 80       	push   $0x80107b6c
801065e6:	e8 f5 b6 ff ff       	call   80101ce0 <cprintf>
            tf->err, cpuid(), tf->eip, rcr2());
    myproc()->killed = 1;
801065eb:	83 c4 20             	add    $0x20,%esp
801065ee:	e8 4d d3 ff ff       	call   80103940 <myproc>
801065f3:	c7 40 24 01 00 00 00 	movl   $0x1,0x24(%eax)
  }

  // Force process exit if it has been killed and is in user space.
  // (If it is still executing in the kernel, let it keep running
  // until it gets to the regular system call return.)
  if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
801065fa:	e8 41 d3 ff ff       	call   80103940 <myproc>
801065ff:	85 c0                	test   %eax,%eax
80106601:	74 1d                	je     80106620 <trap+0xc0>
80106603:	e8 38 d3 ff ff       	call   80103940 <myproc>
80106608:	8b 50 24             	mov    0x24(%eax),%edx
8010660b:	85 d2                	test   %edx,%edx
8010660d:	74 11                	je     80106620 <trap+0xc0>
8010660f:	0f b7 43 3c          	movzwl 0x3c(%ebx),%eax
80106613:	83 e0 03             	and    $0x3,%eax
80106616:	66 83 f8 03          	cmp    $0x3,%ax
8010661a:	0f 84 50 01 00 00    	je     80106770 <trap+0x210>
    exit();

  // Force process to give up CPU on clock tick.
  // If interrupts were on while locks held, would need to check nlock.
  if(myproc() && myproc()->state == RUNNING &&
80106620:	e8 1b d3 ff ff       	call   80103940 <myproc>
80106625:	85 c0                	test   %eax,%eax
80106627:	74 0f                	je     80106638 <trap+0xd8>
80106629:	e8 12 d3 ff ff       	call   80103940 <myproc>
8010662e:	83 78 0c 04          	cmpl   $0x4,0xc(%eax)
80106632:	0f 84 e8 00 00 00    	je     80106720 <trap+0x1c0>
     tf->trapno == T_IRQ0+IRQ_TIMER)
    yield();

  // Check if the process has been killed since we yielded
  if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
80106638:	e8 03 d3 ff ff       	call   80103940 <myproc>
8010663d:	85 c0                	test   %eax,%eax
8010663f:	74 1d                	je     8010665e <trap+0xfe>
80106641:	e8 fa d2 ff ff       	call   80103940 <myproc>
80106646:	8b 40 24             	mov    0x24(%eax),%eax
80106649:	85 c0                	test   %eax,%eax
8010664b:	74 11                	je     8010665e <trap+0xfe>
8010664d:	0f b7 43 3c          	movzwl 0x3c(%ebx),%eax
80106651:	83 e0 03             	and    $0x3,%eax
80106654:	66 83 f8 03          	cmp    $0x3,%ax
80106658:	0f 84 03 01 00 00    	je     80106761 <trap+0x201>
    exit();
}
8010665e:	8d 65 f4             	lea    -0xc(%ebp),%esp
80106661:	5b                   	pop    %ebx
80106662:	5e                   	pop    %esi
80106663:	5f                   	pop    %edi
80106664:	5d                   	pop    %ebp
80106665:	c3                   	ret    
    ideintr();
80106666:	e8 55 cf ff ff       	call   801035c0 <ideintr>
    lapiceoi();
8010666b:	e8 60 a1 ff ff       	call   801007d0 <lapiceoi>
  if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
80106670:	e8 cb d2 ff ff       	call   80103940 <myproc>
80106675:	85 c0                	test   %eax,%eax
80106677:	75 8a                	jne    80106603 <trap+0xa3>
80106679:	eb a5                	jmp    80106620 <trap+0xc0>
    if(cpuid() == 0){
8010667b:	e8 a0 d2 ff ff       	call   80103920 <cpuid>
80106680:	85 c0                	test   %eax,%eax
80106682:	75 e7                	jne    8010666b <trap+0x10b>
      acquire(&tickslock);
80106684:	83 ec 0c             	sub    $0xc,%esp
80106687:	68 a0 41 11 80       	push   $0x801141a0
8010668c:	e8 ff 9d ff ff       	call   80100490 <acquire>
      wakeup(&ticks);
80106691:	c7 04 24 e0 49 11 80 	movl   $0x801149e0,(%esp)
      ticks++;
80106698:	83 05 e0 49 11 80 01 	addl   $0x1,0x801149e0
      wakeup(&ticks);
8010669f:	e8 7c da ff ff       	call   80104120 <wakeup>
      release(&tickslock);
801066a4:	c7 04 24 a0 41 11 80 	movl   $0x801141a0,(%esp)
801066ab:	e8 a0 9e ff ff       	call   80100550 <release>
801066b0:	83 c4 10             	add    $0x10,%esp
    lapiceoi();
801066b3:	eb b6                	jmp    8010666b <trap+0x10b>
    kbdintr();
801066b5:	e8 d6 ba ff ff       	call   80102190 <kbdintr>
    lapiceoi();
801066ba:	e8 11 a1 ff ff       	call   801007d0 <lapiceoi>
  if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
801066bf:	e8 7c d2 ff ff       	call   80103940 <myproc>
801066c4:	85 c0                	test   %eax,%eax
801066c6:	0f 85 37 ff ff ff    	jne    80106603 <trap+0xa3>
801066cc:	e9 4f ff ff ff       	jmp    80106620 <trap+0xc0>
    uartintr();
801066d1:	e8 4a bc ff ff       	call   80102320 <uartintr>
    lapiceoi();
801066d6:	e8 f5 a0 ff ff       	call   801007d0 <lapiceoi>
  if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
801066db:	e8 60 d2 ff ff       	call   80103940 <myproc>
801066e0:	85 c0                	test   %eax,%eax
801066e2:	0f 85 1b ff ff ff    	jne    80106603 <trap+0xa3>
801066e8:	e9 33 ff ff ff       	jmp    80106620 <trap+0xc0>
    cprintf("cpu%d: spurious interrupt at %x:%x\n",
801066ed:	8b 7b 38             	mov    0x38(%ebx),%edi
801066f0:	0f b7 73 3c          	movzwl 0x3c(%ebx),%esi
801066f4:	e8 27 d2 ff ff       	call   80103920 <cpuid>
801066f9:	57                   	push   %edi
801066fa:	56                   	push   %esi
801066fb:	50                   	push   %eax
801066fc:	68 14 7b 10 80       	push   $0x80107b14
80106701:	e8 da b5 ff ff       	call   80101ce0 <cprintf>
    lapiceoi();
80106706:	e8 c5 a0 ff ff       	call   801007d0 <lapiceoi>
    break;
8010670b:	83 c4 10             	add    $0x10,%esp
  if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
8010670e:	e8 2d d2 ff ff       	call   80103940 <myproc>
80106713:	85 c0                	test   %eax,%eax
80106715:	0f 85 e8 fe ff ff    	jne    80106603 <trap+0xa3>
8010671b:	e9 00 ff ff ff       	jmp    80106620 <trap+0xc0>
  if(myproc() && myproc()->state == RUNNING &&
80106720:	83 7b 30 20          	cmpl   $0x20,0x30(%ebx)
80106724:	0f 85 0e ff ff ff    	jne    80106638 <trap+0xd8>
    yield();
8010672a:	e8 e1 d7 ff ff       	call   80103f10 <yield>
8010672f:	e9 04 ff ff ff       	jmp    80106638 <trap+0xd8>
80106734:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    if(myproc()->killed)
80106738:	e8 03 d2 ff ff       	call   80103940 <myproc>
8010673d:	8b 70 24             	mov    0x24(%eax),%esi
80106740:	85 f6                	test   %esi,%esi
80106742:	75 3c                	jne    80106780 <trap+0x220>
    myproc()->tf = tf;
80106744:	e8 f7 d1 ff ff       	call   80103940 <myproc>
80106749:	89 58 18             	mov    %ebx,0x18(%eax)
    syscall();
8010674c:	e8 4f ee ff ff       	call   801055a0 <syscall>
    if(myproc()->killed)
80106751:	e8 ea d1 ff ff       	call   80103940 <myproc>
80106756:	8b 48 24             	mov    0x24(%eax),%ecx
80106759:	85 c9                	test   %ecx,%ecx
8010675b:	0f 84 fd fe ff ff    	je     8010665e <trap+0xfe>
}
80106761:	8d 65 f4             	lea    -0xc(%ebp),%esp
80106764:	5b                   	pop    %ebx
80106765:	5e                   	pop    %esi
80106766:	5f                   	pop    %edi
80106767:	5d                   	pop    %ebp
      exit();
80106768:	e9 63 d6 ff ff       	jmp    80103dd0 <exit>
8010676d:	8d 76 00             	lea    0x0(%esi),%esi
    exit();
80106770:	e8 5b d6 ff ff       	call   80103dd0 <exit>
80106775:	e9 a6 fe ff ff       	jmp    80106620 <trap+0xc0>
8010677a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
      exit();
80106780:	e8 4b d6 ff ff       	call   80103dd0 <exit>
80106785:	eb bd                	jmp    80106744 <trap+0x1e4>
80106787:	0f 20 d6             	mov    %cr2,%esi
      cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
8010678a:	e8 91 d1 ff ff       	call   80103920 <cpuid>
8010678f:	83 ec 0c             	sub    $0xc,%esp
80106792:	56                   	push   %esi
80106793:	57                   	push   %edi
80106794:	50                   	push   %eax
80106795:	ff 73 30             	pushl  0x30(%ebx)
80106798:	68 38 7b 10 80       	push   $0x80107b38
8010679d:	e8 3e b5 ff ff       	call   80101ce0 <cprintf>
      panic("trap");
801067a2:	83 c4 14             	add    $0x14,%esp
801067a5:	68 0e 7b 10 80       	push   $0x80107b0e
801067aa:	e8 11 b2 ff ff       	call   801019c0 <panic>

801067af <vector0>:
# generated by vectors.pl - do not edit
# handlers
.globl alltraps
.globl vector0
vector0:
  pushl $0
801067af:	6a 00                	push   $0x0
  pushl $0
801067b1:	6a 00                	push   $0x0
  jmp alltraps
801067b3:	e9 cf fc ff ff       	jmp    80106487 <alltraps>

801067b8 <vector1>:
.globl vector1
vector1:
  pushl $0
801067b8:	6a 00                	push   $0x0
  pushl $1
801067ba:	6a 01                	push   $0x1
  jmp alltraps
801067bc:	e9 c6 fc ff ff       	jmp    80106487 <alltraps>

801067c1 <vector2>:
.globl vector2
vector2:
  pushl $0
801067c1:	6a 00                	push   $0x0
  pushl $2
801067c3:	6a 02                	push   $0x2
  jmp alltraps
801067c5:	e9 bd fc ff ff       	jmp    80106487 <alltraps>

801067ca <vector3>:
.globl vector3
vector3:
  pushl $0
801067ca:	6a 00                	push   $0x0
  pushl $3
801067cc:	6a 03                	push   $0x3
  jmp alltraps
801067ce:	e9 b4 fc ff ff       	jmp    80106487 <alltraps>

801067d3 <vector4>:
.globl vector4
vector4:
  pushl $0
801067d3:	6a 00                	push   $0x0
  pushl $4
801067d5:	6a 04                	push   $0x4
  jmp alltraps
801067d7:	e9 ab fc ff ff       	jmp    80106487 <alltraps>

801067dc <vector5>:
.globl vector5
vector5:
  pushl $0
801067dc:	6a 00                	push   $0x0
  pushl $5
801067de:	6a 05                	push   $0x5
  jmp alltraps
801067e0:	e9 a2 fc ff ff       	jmp    80106487 <alltraps>

801067e5 <vector6>:
.globl vector6
vector6:
  pushl $0
801067e5:	6a 00                	push   $0x0
  pushl $6
801067e7:	6a 06                	push   $0x6
  jmp alltraps
801067e9:	e9 99 fc ff ff       	jmp    80106487 <alltraps>

801067ee <vector7>:
.globl vector7
vector7:
  pushl $0
801067ee:	6a 00                	push   $0x0
  pushl $7
801067f0:	6a 07                	push   $0x7
  jmp alltraps
801067f2:	e9 90 fc ff ff       	jmp    80106487 <alltraps>

801067f7 <vector8>:
.globl vector8
vector8:
  pushl $8
801067f7:	6a 08                	push   $0x8
  jmp alltraps
801067f9:	e9 89 fc ff ff       	jmp    80106487 <alltraps>

801067fe <vector9>:
.globl vector9
vector9:
  pushl $0
801067fe:	6a 00                	push   $0x0
  pushl $9
80106800:	6a 09                	push   $0x9
  jmp alltraps
80106802:	e9 80 fc ff ff       	jmp    80106487 <alltraps>

80106807 <vector10>:
.globl vector10
vector10:
  pushl $10
80106807:	6a 0a                	push   $0xa
  jmp alltraps
80106809:	e9 79 fc ff ff       	jmp    80106487 <alltraps>

8010680e <vector11>:
.globl vector11
vector11:
  pushl $11
8010680e:	6a 0b                	push   $0xb
  jmp alltraps
80106810:	e9 72 fc ff ff       	jmp    80106487 <alltraps>

80106815 <vector12>:
.globl vector12
vector12:
  pushl $12
80106815:	6a 0c                	push   $0xc
  jmp alltraps
80106817:	e9 6b fc ff ff       	jmp    80106487 <alltraps>

8010681c <vector13>:
.globl vector13
vector13:
  pushl $13
8010681c:	6a 0d                	push   $0xd
  jmp alltraps
8010681e:	e9 64 fc ff ff       	jmp    80106487 <alltraps>

80106823 <vector14>:
.globl vector14
vector14:
  pushl $14
80106823:	6a 0e                	push   $0xe
  jmp alltraps
80106825:	e9 5d fc ff ff       	jmp    80106487 <alltraps>

8010682a <vector15>:
.globl vector15
vector15:
  pushl $0
8010682a:	6a 00                	push   $0x0
  pushl $15
8010682c:	6a 0f                	push   $0xf
  jmp alltraps
8010682e:	e9 54 fc ff ff       	jmp    80106487 <alltraps>

80106833 <vector16>:
.globl vector16
vector16:
  pushl $0
80106833:	6a 00                	push   $0x0
  pushl $16
80106835:	6a 10                	push   $0x10
  jmp alltraps
80106837:	e9 4b fc ff ff       	jmp    80106487 <alltraps>

8010683c <vector17>:
.globl vector17
vector17:
  pushl $17
8010683c:	6a 11                	push   $0x11
  jmp alltraps
8010683e:	e9 44 fc ff ff       	jmp    80106487 <alltraps>

80106843 <vector18>:
.globl vector18
vector18:
  pushl $0
80106843:	6a 00                	push   $0x0
  pushl $18
80106845:	6a 12                	push   $0x12
  jmp alltraps
80106847:	e9 3b fc ff ff       	jmp    80106487 <alltraps>

8010684c <vector19>:
.globl vector19
vector19:
  pushl $0
8010684c:	6a 00                	push   $0x0
  pushl $19
8010684e:	6a 13                	push   $0x13
  jmp alltraps
80106850:	e9 32 fc ff ff       	jmp    80106487 <alltraps>

80106855 <vector20>:
.globl vector20
vector20:
  pushl $0
80106855:	6a 00                	push   $0x0
  pushl $20
80106857:	6a 14                	push   $0x14
  jmp alltraps
80106859:	e9 29 fc ff ff       	jmp    80106487 <alltraps>

8010685e <vector21>:
.globl vector21
vector21:
  pushl $0
8010685e:	6a 00                	push   $0x0
  pushl $21
80106860:	6a 15                	push   $0x15
  jmp alltraps
80106862:	e9 20 fc ff ff       	jmp    80106487 <alltraps>

80106867 <vector22>:
.globl vector22
vector22:
  pushl $0
80106867:	6a 00                	push   $0x0
  pushl $22
80106869:	6a 16                	push   $0x16
  jmp alltraps
8010686b:	e9 17 fc ff ff       	jmp    80106487 <alltraps>

80106870 <vector23>:
.globl vector23
vector23:
  pushl $0
80106870:	6a 00                	push   $0x0
  pushl $23
80106872:	6a 17                	push   $0x17
  jmp alltraps
80106874:	e9 0e fc ff ff       	jmp    80106487 <alltraps>

80106879 <vector24>:
.globl vector24
vector24:
  pushl $0
80106879:	6a 00                	push   $0x0
  pushl $24
8010687b:	6a 18                	push   $0x18
  jmp alltraps
8010687d:	e9 05 fc ff ff       	jmp    80106487 <alltraps>

80106882 <vector25>:
.globl vector25
vector25:
  pushl $0
80106882:	6a 00                	push   $0x0
  pushl $25
80106884:	6a 19                	push   $0x19
  jmp alltraps
80106886:	e9 fc fb ff ff       	jmp    80106487 <alltraps>

8010688b <vector26>:
.globl vector26
vector26:
  pushl $0
8010688b:	6a 00                	push   $0x0
  pushl $26
8010688d:	6a 1a                	push   $0x1a
  jmp alltraps
8010688f:	e9 f3 fb ff ff       	jmp    80106487 <alltraps>

80106894 <vector27>:
.globl vector27
vector27:
  pushl $0
80106894:	6a 00                	push   $0x0
  pushl $27
80106896:	6a 1b                	push   $0x1b
  jmp alltraps
80106898:	e9 ea fb ff ff       	jmp    80106487 <alltraps>

8010689d <vector28>:
.globl vector28
vector28:
  pushl $0
8010689d:	6a 00                	push   $0x0
  pushl $28
8010689f:	6a 1c                	push   $0x1c
  jmp alltraps
801068a1:	e9 e1 fb ff ff       	jmp    80106487 <alltraps>

801068a6 <vector29>:
.globl vector29
vector29:
  pushl $0
801068a6:	6a 00                	push   $0x0
  pushl $29
801068a8:	6a 1d                	push   $0x1d
  jmp alltraps
801068aa:	e9 d8 fb ff ff       	jmp    80106487 <alltraps>

801068af <vector30>:
.globl vector30
vector30:
  pushl $0
801068af:	6a 00                	push   $0x0
  pushl $30
801068b1:	6a 1e                	push   $0x1e
  jmp alltraps
801068b3:	e9 cf fb ff ff       	jmp    80106487 <alltraps>

801068b8 <vector31>:
.globl vector31
vector31:
  pushl $0
801068b8:	6a 00                	push   $0x0
  pushl $31
801068ba:	6a 1f                	push   $0x1f
  jmp alltraps
801068bc:	e9 c6 fb ff ff       	jmp    80106487 <alltraps>

801068c1 <vector32>:
.globl vector32
vector32:
  pushl $0
801068c1:	6a 00                	push   $0x0
  pushl $32
801068c3:	6a 20                	push   $0x20
  jmp alltraps
801068c5:	e9 bd fb ff ff       	jmp    80106487 <alltraps>

801068ca <vector33>:
.globl vector33
vector33:
  pushl $0
801068ca:	6a 00                	push   $0x0
  pushl $33
801068cc:	6a 21                	push   $0x21
  jmp alltraps
801068ce:	e9 b4 fb ff ff       	jmp    80106487 <alltraps>

801068d3 <vector34>:
.globl vector34
vector34:
  pushl $0
801068d3:	6a 00                	push   $0x0
  pushl $34
801068d5:	6a 22                	push   $0x22
  jmp alltraps
801068d7:	e9 ab fb ff ff       	jmp    80106487 <alltraps>

801068dc <vector35>:
.globl vector35
vector35:
  pushl $0
801068dc:	6a 00                	push   $0x0
  pushl $35
801068de:	6a 23                	push   $0x23
  jmp alltraps
801068e0:	e9 a2 fb ff ff       	jmp    80106487 <alltraps>

801068e5 <vector36>:
.globl vector36
vector36:
  pushl $0
801068e5:	6a 00                	push   $0x0
  pushl $36
801068e7:	6a 24                	push   $0x24
  jmp alltraps
801068e9:	e9 99 fb ff ff       	jmp    80106487 <alltraps>

801068ee <vector37>:
.globl vector37
vector37:
  pushl $0
801068ee:	6a 00                	push   $0x0
  pushl $37
801068f0:	6a 25                	push   $0x25
  jmp alltraps
801068f2:	e9 90 fb ff ff       	jmp    80106487 <alltraps>

801068f7 <vector38>:
.globl vector38
vector38:
  pushl $0
801068f7:	6a 00                	push   $0x0
  pushl $38
801068f9:	6a 26                	push   $0x26
  jmp alltraps
801068fb:	e9 87 fb ff ff       	jmp    80106487 <alltraps>

80106900 <vector39>:
.globl vector39
vector39:
  pushl $0
80106900:	6a 00                	push   $0x0
  pushl $39
80106902:	6a 27                	push   $0x27
  jmp alltraps
80106904:	e9 7e fb ff ff       	jmp    80106487 <alltraps>

80106909 <vector40>:
.globl vector40
vector40:
  pushl $0
80106909:	6a 00                	push   $0x0
  pushl $40
8010690b:	6a 28                	push   $0x28
  jmp alltraps
8010690d:	e9 75 fb ff ff       	jmp    80106487 <alltraps>

80106912 <vector41>:
.globl vector41
vector41:
  pushl $0
80106912:	6a 00                	push   $0x0
  pushl $41
80106914:	6a 29                	push   $0x29
  jmp alltraps
80106916:	e9 6c fb ff ff       	jmp    80106487 <alltraps>

8010691b <vector42>:
.globl vector42
vector42:
  pushl $0
8010691b:	6a 00                	push   $0x0
  pushl $42
8010691d:	6a 2a                	push   $0x2a
  jmp alltraps
8010691f:	e9 63 fb ff ff       	jmp    80106487 <alltraps>

80106924 <vector43>:
.globl vector43
vector43:
  pushl $0
80106924:	6a 00                	push   $0x0
  pushl $43
80106926:	6a 2b                	push   $0x2b
  jmp alltraps
80106928:	e9 5a fb ff ff       	jmp    80106487 <alltraps>

8010692d <vector44>:
.globl vector44
vector44:
  pushl $0
8010692d:	6a 00                	push   $0x0
  pushl $44
8010692f:	6a 2c                	push   $0x2c
  jmp alltraps
80106931:	e9 51 fb ff ff       	jmp    80106487 <alltraps>

80106936 <vector45>:
.globl vector45
vector45:
  pushl $0
80106936:	6a 00                	push   $0x0
  pushl $45
80106938:	6a 2d                	push   $0x2d
  jmp alltraps
8010693a:	e9 48 fb ff ff       	jmp    80106487 <alltraps>

8010693f <vector46>:
.globl vector46
vector46:
  pushl $0
8010693f:	6a 00                	push   $0x0
  pushl $46
80106941:	6a 2e                	push   $0x2e
  jmp alltraps
80106943:	e9 3f fb ff ff       	jmp    80106487 <alltraps>

80106948 <vector47>:
.globl vector47
vector47:
  pushl $0
80106948:	6a 00                	push   $0x0
  pushl $47
8010694a:	6a 2f                	push   $0x2f
  jmp alltraps
8010694c:	e9 36 fb ff ff       	jmp    80106487 <alltraps>

80106951 <vector48>:
.globl vector48
vector48:
  pushl $0
80106951:	6a 00                	push   $0x0
  pushl $48
80106953:	6a 30                	push   $0x30
  jmp alltraps
80106955:	e9 2d fb ff ff       	jmp    80106487 <alltraps>

8010695a <vector49>:
.globl vector49
vector49:
  pushl $0
8010695a:	6a 00                	push   $0x0
  pushl $49
8010695c:	6a 31                	push   $0x31
  jmp alltraps
8010695e:	e9 24 fb ff ff       	jmp    80106487 <alltraps>

80106963 <vector50>:
.globl vector50
vector50:
  pushl $0
80106963:	6a 00                	push   $0x0
  pushl $50
80106965:	6a 32                	push   $0x32
  jmp alltraps
80106967:	e9 1b fb ff ff       	jmp    80106487 <alltraps>

8010696c <vector51>:
.globl vector51
vector51:
  pushl $0
8010696c:	6a 00                	push   $0x0
  pushl $51
8010696e:	6a 33                	push   $0x33
  jmp alltraps
80106970:	e9 12 fb ff ff       	jmp    80106487 <alltraps>

80106975 <vector52>:
.globl vector52
vector52:
  pushl $0
80106975:	6a 00                	push   $0x0
  pushl $52
80106977:	6a 34                	push   $0x34
  jmp alltraps
80106979:	e9 09 fb ff ff       	jmp    80106487 <alltraps>

8010697e <vector53>:
.globl vector53
vector53:
  pushl $0
8010697e:	6a 00                	push   $0x0
  pushl $53
80106980:	6a 35                	push   $0x35
  jmp alltraps
80106982:	e9 00 fb ff ff       	jmp    80106487 <alltraps>

80106987 <vector54>:
.globl vector54
vector54:
  pushl $0
80106987:	6a 00                	push   $0x0
  pushl $54
80106989:	6a 36                	push   $0x36
  jmp alltraps
8010698b:	e9 f7 fa ff ff       	jmp    80106487 <alltraps>

80106990 <vector55>:
.globl vector55
vector55:
  pushl $0
80106990:	6a 00                	push   $0x0
  pushl $55
80106992:	6a 37                	push   $0x37
  jmp alltraps
80106994:	e9 ee fa ff ff       	jmp    80106487 <alltraps>

80106999 <vector56>:
.globl vector56
vector56:
  pushl $0
80106999:	6a 00                	push   $0x0
  pushl $56
8010699b:	6a 38                	push   $0x38
  jmp alltraps
8010699d:	e9 e5 fa ff ff       	jmp    80106487 <alltraps>

801069a2 <vector57>:
.globl vector57
vector57:
  pushl $0
801069a2:	6a 00                	push   $0x0
  pushl $57
801069a4:	6a 39                	push   $0x39
  jmp alltraps
801069a6:	e9 dc fa ff ff       	jmp    80106487 <alltraps>

801069ab <vector58>:
.globl vector58
vector58:
  pushl $0
801069ab:	6a 00                	push   $0x0
  pushl $58
801069ad:	6a 3a                	push   $0x3a
  jmp alltraps
801069af:	e9 d3 fa ff ff       	jmp    80106487 <alltraps>

801069b4 <vector59>:
.globl vector59
vector59:
  pushl $0
801069b4:	6a 00                	push   $0x0
  pushl $59
801069b6:	6a 3b                	push   $0x3b
  jmp alltraps
801069b8:	e9 ca fa ff ff       	jmp    80106487 <alltraps>

801069bd <vector60>:
.globl vector60
vector60:
  pushl $0
801069bd:	6a 00                	push   $0x0
  pushl $60
801069bf:	6a 3c                	push   $0x3c
  jmp alltraps
801069c1:	e9 c1 fa ff ff       	jmp    80106487 <alltraps>

801069c6 <vector61>:
.globl vector61
vector61:
  pushl $0
801069c6:	6a 00                	push   $0x0
  pushl $61
801069c8:	6a 3d                	push   $0x3d
  jmp alltraps
801069ca:	e9 b8 fa ff ff       	jmp    80106487 <alltraps>

801069cf <vector62>:
.globl vector62
vector62:
  pushl $0
801069cf:	6a 00                	push   $0x0
  pushl $62
801069d1:	6a 3e                	push   $0x3e
  jmp alltraps
801069d3:	e9 af fa ff ff       	jmp    80106487 <alltraps>

801069d8 <vector63>:
.globl vector63
vector63:
  pushl $0
801069d8:	6a 00                	push   $0x0
  pushl $63
801069da:	6a 3f                	push   $0x3f
  jmp alltraps
801069dc:	e9 a6 fa ff ff       	jmp    80106487 <alltraps>

801069e1 <vector64>:
.globl vector64
vector64:
  pushl $0
801069e1:	6a 00                	push   $0x0
  pushl $64
801069e3:	6a 40                	push   $0x40
  jmp alltraps
801069e5:	e9 9d fa ff ff       	jmp    80106487 <alltraps>

801069ea <vector65>:
.globl vector65
vector65:
  pushl $0
801069ea:	6a 00                	push   $0x0
  pushl $65
801069ec:	6a 41                	push   $0x41
  jmp alltraps
801069ee:	e9 94 fa ff ff       	jmp    80106487 <alltraps>

801069f3 <vector66>:
.globl vector66
vector66:
  pushl $0
801069f3:	6a 00                	push   $0x0
  pushl $66
801069f5:	6a 42                	push   $0x42
  jmp alltraps
801069f7:	e9 8b fa ff ff       	jmp    80106487 <alltraps>

801069fc <vector67>:
.globl vector67
vector67:
  pushl $0
801069fc:	6a 00                	push   $0x0
  pushl $67
801069fe:	6a 43                	push   $0x43
  jmp alltraps
80106a00:	e9 82 fa ff ff       	jmp    80106487 <alltraps>

80106a05 <vector68>:
.globl vector68
vector68:
  pushl $0
80106a05:	6a 00                	push   $0x0
  pushl $68
80106a07:	6a 44                	push   $0x44
  jmp alltraps
80106a09:	e9 79 fa ff ff       	jmp    80106487 <alltraps>

80106a0e <vector69>:
.globl vector69
vector69:
  pushl $0
80106a0e:	6a 00                	push   $0x0
  pushl $69
80106a10:	6a 45                	push   $0x45
  jmp alltraps
80106a12:	e9 70 fa ff ff       	jmp    80106487 <alltraps>

80106a17 <vector70>:
.globl vector70
vector70:
  pushl $0
80106a17:	6a 00                	push   $0x0
  pushl $70
80106a19:	6a 46                	push   $0x46
  jmp alltraps
80106a1b:	e9 67 fa ff ff       	jmp    80106487 <alltraps>

80106a20 <vector71>:
.globl vector71
vector71:
  pushl $0
80106a20:	6a 00                	push   $0x0
  pushl $71
80106a22:	6a 47                	push   $0x47
  jmp alltraps
80106a24:	e9 5e fa ff ff       	jmp    80106487 <alltraps>

80106a29 <vector72>:
.globl vector72
vector72:
  pushl $0
80106a29:	6a 00                	push   $0x0
  pushl $72
80106a2b:	6a 48                	push   $0x48
  jmp alltraps
80106a2d:	e9 55 fa ff ff       	jmp    80106487 <alltraps>

80106a32 <vector73>:
.globl vector73
vector73:
  pushl $0
80106a32:	6a 00                	push   $0x0
  pushl $73
80106a34:	6a 49                	push   $0x49
  jmp alltraps
80106a36:	e9 4c fa ff ff       	jmp    80106487 <alltraps>

80106a3b <vector74>:
.globl vector74
vector74:
  pushl $0
80106a3b:	6a 00                	push   $0x0
  pushl $74
80106a3d:	6a 4a                	push   $0x4a
  jmp alltraps
80106a3f:	e9 43 fa ff ff       	jmp    80106487 <alltraps>

80106a44 <vector75>:
.globl vector75
vector75:
  pushl $0
80106a44:	6a 00                	push   $0x0
  pushl $75
80106a46:	6a 4b                	push   $0x4b
  jmp alltraps
80106a48:	e9 3a fa ff ff       	jmp    80106487 <alltraps>

80106a4d <vector76>:
.globl vector76
vector76:
  pushl $0
80106a4d:	6a 00                	push   $0x0
  pushl $76
80106a4f:	6a 4c                	push   $0x4c
  jmp alltraps
80106a51:	e9 31 fa ff ff       	jmp    80106487 <alltraps>

80106a56 <vector77>:
.globl vector77
vector77:
  pushl $0
80106a56:	6a 00                	push   $0x0
  pushl $77
80106a58:	6a 4d                	push   $0x4d
  jmp alltraps
80106a5a:	e9 28 fa ff ff       	jmp    80106487 <alltraps>

80106a5f <vector78>:
.globl vector78
vector78:
  pushl $0
80106a5f:	6a 00                	push   $0x0
  pushl $78
80106a61:	6a 4e                	push   $0x4e
  jmp alltraps
80106a63:	e9 1f fa ff ff       	jmp    80106487 <alltraps>

80106a68 <vector79>:
.globl vector79
vector79:
  pushl $0
80106a68:	6a 00                	push   $0x0
  pushl $79
80106a6a:	6a 4f                	push   $0x4f
  jmp alltraps
80106a6c:	e9 16 fa ff ff       	jmp    80106487 <alltraps>

80106a71 <vector80>:
.globl vector80
vector80:
  pushl $0
80106a71:	6a 00                	push   $0x0
  pushl $80
80106a73:	6a 50                	push   $0x50
  jmp alltraps
80106a75:	e9 0d fa ff ff       	jmp    80106487 <alltraps>

80106a7a <vector81>:
.globl vector81
vector81:
  pushl $0
80106a7a:	6a 00                	push   $0x0
  pushl $81
80106a7c:	6a 51                	push   $0x51
  jmp alltraps
80106a7e:	e9 04 fa ff ff       	jmp    80106487 <alltraps>

80106a83 <vector82>:
.globl vector82
vector82:
  pushl $0
80106a83:	6a 00                	push   $0x0
  pushl $82
80106a85:	6a 52                	push   $0x52
  jmp alltraps
80106a87:	e9 fb f9 ff ff       	jmp    80106487 <alltraps>

80106a8c <vector83>:
.globl vector83
vector83:
  pushl $0
80106a8c:	6a 00                	push   $0x0
  pushl $83
80106a8e:	6a 53                	push   $0x53
  jmp alltraps
80106a90:	e9 f2 f9 ff ff       	jmp    80106487 <alltraps>

80106a95 <vector84>:
.globl vector84
vector84:
  pushl $0
80106a95:	6a 00                	push   $0x0
  pushl $84
80106a97:	6a 54                	push   $0x54
  jmp alltraps
80106a99:	e9 e9 f9 ff ff       	jmp    80106487 <alltraps>

80106a9e <vector85>:
.globl vector85
vector85:
  pushl $0
80106a9e:	6a 00                	push   $0x0
  pushl $85
80106aa0:	6a 55                	push   $0x55
  jmp alltraps
80106aa2:	e9 e0 f9 ff ff       	jmp    80106487 <alltraps>

80106aa7 <vector86>:
.globl vector86
vector86:
  pushl $0
80106aa7:	6a 00                	push   $0x0
  pushl $86
80106aa9:	6a 56                	push   $0x56
  jmp alltraps
80106aab:	e9 d7 f9 ff ff       	jmp    80106487 <alltraps>

80106ab0 <vector87>:
.globl vector87
vector87:
  pushl $0
80106ab0:	6a 00                	push   $0x0
  pushl $87
80106ab2:	6a 57                	push   $0x57
  jmp alltraps
80106ab4:	e9 ce f9 ff ff       	jmp    80106487 <alltraps>

80106ab9 <vector88>:
.globl vector88
vector88:
  pushl $0
80106ab9:	6a 00                	push   $0x0
  pushl $88
80106abb:	6a 58                	push   $0x58
  jmp alltraps
80106abd:	e9 c5 f9 ff ff       	jmp    80106487 <alltraps>

80106ac2 <vector89>:
.globl vector89
vector89:
  pushl $0
80106ac2:	6a 00                	push   $0x0
  pushl $89
80106ac4:	6a 59                	push   $0x59
  jmp alltraps
80106ac6:	e9 bc f9 ff ff       	jmp    80106487 <alltraps>

80106acb <vector90>:
.globl vector90
vector90:
  pushl $0
80106acb:	6a 00                	push   $0x0
  pushl $90
80106acd:	6a 5a                	push   $0x5a
  jmp alltraps
80106acf:	e9 b3 f9 ff ff       	jmp    80106487 <alltraps>

80106ad4 <vector91>:
.globl vector91
vector91:
  pushl $0
80106ad4:	6a 00                	push   $0x0
  pushl $91
80106ad6:	6a 5b                	push   $0x5b
  jmp alltraps
80106ad8:	e9 aa f9 ff ff       	jmp    80106487 <alltraps>

80106add <vector92>:
.globl vector92
vector92:
  pushl $0
80106add:	6a 00                	push   $0x0
  pushl $92
80106adf:	6a 5c                	push   $0x5c
  jmp alltraps
80106ae1:	e9 a1 f9 ff ff       	jmp    80106487 <alltraps>

80106ae6 <vector93>:
.globl vector93
vector93:
  pushl $0
80106ae6:	6a 00                	push   $0x0
  pushl $93
80106ae8:	6a 5d                	push   $0x5d
  jmp alltraps
80106aea:	e9 98 f9 ff ff       	jmp    80106487 <alltraps>

80106aef <vector94>:
.globl vector94
vector94:
  pushl $0
80106aef:	6a 00                	push   $0x0
  pushl $94
80106af1:	6a 5e                	push   $0x5e
  jmp alltraps
80106af3:	e9 8f f9 ff ff       	jmp    80106487 <alltraps>

80106af8 <vector95>:
.globl vector95
vector95:
  pushl $0
80106af8:	6a 00                	push   $0x0
  pushl $95
80106afa:	6a 5f                	push   $0x5f
  jmp alltraps
80106afc:	e9 86 f9 ff ff       	jmp    80106487 <alltraps>

80106b01 <vector96>:
.globl vector96
vector96:
  pushl $0
80106b01:	6a 00                	push   $0x0
  pushl $96
80106b03:	6a 60                	push   $0x60
  jmp alltraps
80106b05:	e9 7d f9 ff ff       	jmp    80106487 <alltraps>

80106b0a <vector97>:
.globl vector97
vector97:
  pushl $0
80106b0a:	6a 00                	push   $0x0
  pushl $97
80106b0c:	6a 61                	push   $0x61
  jmp alltraps
80106b0e:	e9 74 f9 ff ff       	jmp    80106487 <alltraps>

80106b13 <vector98>:
.globl vector98
vector98:
  pushl $0
80106b13:	6a 00                	push   $0x0
  pushl $98
80106b15:	6a 62                	push   $0x62
  jmp alltraps
80106b17:	e9 6b f9 ff ff       	jmp    80106487 <alltraps>

80106b1c <vector99>:
.globl vector99
vector99:
  pushl $0
80106b1c:	6a 00                	push   $0x0
  pushl $99
80106b1e:	6a 63                	push   $0x63
  jmp alltraps
80106b20:	e9 62 f9 ff ff       	jmp    80106487 <alltraps>

80106b25 <vector100>:
.globl vector100
vector100:
  pushl $0
80106b25:	6a 00                	push   $0x0
  pushl $100
80106b27:	6a 64                	push   $0x64
  jmp alltraps
80106b29:	e9 59 f9 ff ff       	jmp    80106487 <alltraps>

80106b2e <vector101>:
.globl vector101
vector101:
  pushl $0
80106b2e:	6a 00                	push   $0x0
  pushl $101
80106b30:	6a 65                	push   $0x65
  jmp alltraps
80106b32:	e9 50 f9 ff ff       	jmp    80106487 <alltraps>

80106b37 <vector102>:
.globl vector102
vector102:
  pushl $0
80106b37:	6a 00                	push   $0x0
  pushl $102
80106b39:	6a 66                	push   $0x66
  jmp alltraps
80106b3b:	e9 47 f9 ff ff       	jmp    80106487 <alltraps>

80106b40 <vector103>:
.globl vector103
vector103:
  pushl $0
80106b40:	6a 00                	push   $0x0
  pushl $103
80106b42:	6a 67                	push   $0x67
  jmp alltraps
80106b44:	e9 3e f9 ff ff       	jmp    80106487 <alltraps>

80106b49 <vector104>:
.globl vector104
vector104:
  pushl $0
80106b49:	6a 00                	push   $0x0
  pushl $104
80106b4b:	6a 68                	push   $0x68
  jmp alltraps
80106b4d:	e9 35 f9 ff ff       	jmp    80106487 <alltraps>

80106b52 <vector105>:
.globl vector105
vector105:
  pushl $0
80106b52:	6a 00                	push   $0x0
  pushl $105
80106b54:	6a 69                	push   $0x69
  jmp alltraps
80106b56:	e9 2c f9 ff ff       	jmp    80106487 <alltraps>

80106b5b <vector106>:
.globl vector106
vector106:
  pushl $0
80106b5b:	6a 00                	push   $0x0
  pushl $106
80106b5d:	6a 6a                	push   $0x6a
  jmp alltraps
80106b5f:	e9 23 f9 ff ff       	jmp    80106487 <alltraps>

80106b64 <vector107>:
.globl vector107
vector107:
  pushl $0
80106b64:	6a 00                	push   $0x0
  pushl $107
80106b66:	6a 6b                	push   $0x6b
  jmp alltraps
80106b68:	e9 1a f9 ff ff       	jmp    80106487 <alltraps>

80106b6d <vector108>:
.globl vector108
vector108:
  pushl $0
80106b6d:	6a 00                	push   $0x0
  pushl $108
80106b6f:	6a 6c                	push   $0x6c
  jmp alltraps
80106b71:	e9 11 f9 ff ff       	jmp    80106487 <alltraps>

80106b76 <vector109>:
.globl vector109
vector109:
  pushl $0
80106b76:	6a 00                	push   $0x0
  pushl $109
80106b78:	6a 6d                	push   $0x6d
  jmp alltraps
80106b7a:	e9 08 f9 ff ff       	jmp    80106487 <alltraps>

80106b7f <vector110>:
.globl vector110
vector110:
  pushl $0
80106b7f:	6a 00                	push   $0x0
  pushl $110
80106b81:	6a 6e                	push   $0x6e
  jmp alltraps
80106b83:	e9 ff f8 ff ff       	jmp    80106487 <alltraps>

80106b88 <vector111>:
.globl vector111
vector111:
  pushl $0
80106b88:	6a 00                	push   $0x0
  pushl $111
80106b8a:	6a 6f                	push   $0x6f
  jmp alltraps
80106b8c:	e9 f6 f8 ff ff       	jmp    80106487 <alltraps>

80106b91 <vector112>:
.globl vector112
vector112:
  pushl $0
80106b91:	6a 00                	push   $0x0
  pushl $112
80106b93:	6a 70                	push   $0x70
  jmp alltraps
80106b95:	e9 ed f8 ff ff       	jmp    80106487 <alltraps>

80106b9a <vector113>:
.globl vector113
vector113:
  pushl $0
80106b9a:	6a 00                	push   $0x0
  pushl $113
80106b9c:	6a 71                	push   $0x71
  jmp alltraps
80106b9e:	e9 e4 f8 ff ff       	jmp    80106487 <alltraps>

80106ba3 <vector114>:
.globl vector114
vector114:
  pushl $0
80106ba3:	6a 00                	push   $0x0
  pushl $114
80106ba5:	6a 72                	push   $0x72
  jmp alltraps
80106ba7:	e9 db f8 ff ff       	jmp    80106487 <alltraps>

80106bac <vector115>:
.globl vector115
vector115:
  pushl $0
80106bac:	6a 00                	push   $0x0
  pushl $115
80106bae:	6a 73                	push   $0x73
  jmp alltraps
80106bb0:	e9 d2 f8 ff ff       	jmp    80106487 <alltraps>

80106bb5 <vector116>:
.globl vector116
vector116:
  pushl $0
80106bb5:	6a 00                	push   $0x0
  pushl $116
80106bb7:	6a 74                	push   $0x74
  jmp alltraps
80106bb9:	e9 c9 f8 ff ff       	jmp    80106487 <alltraps>

80106bbe <vector117>:
.globl vector117
vector117:
  pushl $0
80106bbe:	6a 00                	push   $0x0
  pushl $117
80106bc0:	6a 75                	push   $0x75
  jmp alltraps
80106bc2:	e9 c0 f8 ff ff       	jmp    80106487 <alltraps>

80106bc7 <vector118>:
.globl vector118
vector118:
  pushl $0
80106bc7:	6a 00                	push   $0x0
  pushl $118
80106bc9:	6a 76                	push   $0x76
  jmp alltraps
80106bcb:	e9 b7 f8 ff ff       	jmp    80106487 <alltraps>

80106bd0 <vector119>:
.globl vector119
vector119:
  pushl $0
80106bd0:	6a 00                	push   $0x0
  pushl $119
80106bd2:	6a 77                	push   $0x77
  jmp alltraps
80106bd4:	e9 ae f8 ff ff       	jmp    80106487 <alltraps>

80106bd9 <vector120>:
.globl vector120
vector120:
  pushl $0
80106bd9:	6a 00                	push   $0x0
  pushl $120
80106bdb:	6a 78                	push   $0x78
  jmp alltraps
80106bdd:	e9 a5 f8 ff ff       	jmp    80106487 <alltraps>

80106be2 <vector121>:
.globl vector121
vector121:
  pushl $0
80106be2:	6a 00                	push   $0x0
  pushl $121
80106be4:	6a 79                	push   $0x79
  jmp alltraps
80106be6:	e9 9c f8 ff ff       	jmp    80106487 <alltraps>

80106beb <vector122>:
.globl vector122
vector122:
  pushl $0
80106beb:	6a 00                	push   $0x0
  pushl $122
80106bed:	6a 7a                	push   $0x7a
  jmp alltraps
80106bef:	e9 93 f8 ff ff       	jmp    80106487 <alltraps>

80106bf4 <vector123>:
.globl vector123
vector123:
  pushl $0
80106bf4:	6a 00                	push   $0x0
  pushl $123
80106bf6:	6a 7b                	push   $0x7b
  jmp alltraps
80106bf8:	e9 8a f8 ff ff       	jmp    80106487 <alltraps>

80106bfd <vector124>:
.globl vector124
vector124:
  pushl $0
80106bfd:	6a 00                	push   $0x0
  pushl $124
80106bff:	6a 7c                	push   $0x7c
  jmp alltraps
80106c01:	e9 81 f8 ff ff       	jmp    80106487 <alltraps>

80106c06 <vector125>:
.globl vector125
vector125:
  pushl $0
80106c06:	6a 00                	push   $0x0
  pushl $125
80106c08:	6a 7d                	push   $0x7d
  jmp alltraps
80106c0a:	e9 78 f8 ff ff       	jmp    80106487 <alltraps>

80106c0f <vector126>:
.globl vector126
vector126:
  pushl $0
80106c0f:	6a 00                	push   $0x0
  pushl $126
80106c11:	6a 7e                	push   $0x7e
  jmp alltraps
80106c13:	e9 6f f8 ff ff       	jmp    80106487 <alltraps>

80106c18 <vector127>:
.globl vector127
vector127:
  pushl $0
80106c18:	6a 00                	push   $0x0
  pushl $127
80106c1a:	6a 7f                	push   $0x7f
  jmp alltraps
80106c1c:	e9 66 f8 ff ff       	jmp    80106487 <alltraps>

80106c21 <vector128>:
.globl vector128
vector128:
  pushl $0
80106c21:	6a 00                	push   $0x0
  pushl $128
80106c23:	68 80 00 00 00       	push   $0x80
  jmp alltraps
80106c28:	e9 5a f8 ff ff       	jmp    80106487 <alltraps>

80106c2d <vector129>:
.globl vector129
vector129:
  pushl $0
80106c2d:	6a 00                	push   $0x0
  pushl $129
80106c2f:	68 81 00 00 00       	push   $0x81
  jmp alltraps
80106c34:	e9 4e f8 ff ff       	jmp    80106487 <alltraps>

80106c39 <vector130>:
.globl vector130
vector130:
  pushl $0
80106c39:	6a 00                	push   $0x0
  pushl $130
80106c3b:	68 82 00 00 00       	push   $0x82
  jmp alltraps
80106c40:	e9 42 f8 ff ff       	jmp    80106487 <alltraps>

80106c45 <vector131>:
.globl vector131
vector131:
  pushl $0
80106c45:	6a 00                	push   $0x0
  pushl $131
80106c47:	68 83 00 00 00       	push   $0x83
  jmp alltraps
80106c4c:	e9 36 f8 ff ff       	jmp    80106487 <alltraps>

80106c51 <vector132>:
.globl vector132
vector132:
  pushl $0
80106c51:	6a 00                	push   $0x0
  pushl $132
80106c53:	68 84 00 00 00       	push   $0x84
  jmp alltraps
80106c58:	e9 2a f8 ff ff       	jmp    80106487 <alltraps>

80106c5d <vector133>:
.globl vector133
vector133:
  pushl $0
80106c5d:	6a 00                	push   $0x0
  pushl $133
80106c5f:	68 85 00 00 00       	push   $0x85
  jmp alltraps
80106c64:	e9 1e f8 ff ff       	jmp    80106487 <alltraps>

80106c69 <vector134>:
.globl vector134
vector134:
  pushl $0
80106c69:	6a 00                	push   $0x0
  pushl $134
80106c6b:	68 86 00 00 00       	push   $0x86
  jmp alltraps
80106c70:	e9 12 f8 ff ff       	jmp    80106487 <alltraps>

80106c75 <vector135>:
.globl vector135
vector135:
  pushl $0
80106c75:	6a 00                	push   $0x0
  pushl $135
80106c77:	68 87 00 00 00       	push   $0x87
  jmp alltraps
80106c7c:	e9 06 f8 ff ff       	jmp    80106487 <alltraps>

80106c81 <vector136>:
.globl vector136
vector136:
  pushl $0
80106c81:	6a 00                	push   $0x0
  pushl $136
80106c83:	68 88 00 00 00       	push   $0x88
  jmp alltraps
80106c88:	e9 fa f7 ff ff       	jmp    80106487 <alltraps>

80106c8d <vector137>:
.globl vector137
vector137:
  pushl $0
80106c8d:	6a 00                	push   $0x0
  pushl $137
80106c8f:	68 89 00 00 00       	push   $0x89
  jmp alltraps
80106c94:	e9 ee f7 ff ff       	jmp    80106487 <alltraps>

80106c99 <vector138>:
.globl vector138
vector138:
  pushl $0
80106c99:	6a 00                	push   $0x0
  pushl $138
80106c9b:	68 8a 00 00 00       	push   $0x8a
  jmp alltraps
80106ca0:	e9 e2 f7 ff ff       	jmp    80106487 <alltraps>

80106ca5 <vector139>:
.globl vector139
vector139:
  pushl $0
80106ca5:	6a 00                	push   $0x0
  pushl $139
80106ca7:	68 8b 00 00 00       	push   $0x8b
  jmp alltraps
80106cac:	e9 d6 f7 ff ff       	jmp    80106487 <alltraps>

80106cb1 <vector140>:
.globl vector140
vector140:
  pushl $0
80106cb1:	6a 00                	push   $0x0
  pushl $140
80106cb3:	68 8c 00 00 00       	push   $0x8c
  jmp alltraps
80106cb8:	e9 ca f7 ff ff       	jmp    80106487 <alltraps>

80106cbd <vector141>:
.globl vector141
vector141:
  pushl $0
80106cbd:	6a 00                	push   $0x0
  pushl $141
80106cbf:	68 8d 00 00 00       	push   $0x8d
  jmp alltraps
80106cc4:	e9 be f7 ff ff       	jmp    80106487 <alltraps>

80106cc9 <vector142>:
.globl vector142
vector142:
  pushl $0
80106cc9:	6a 00                	push   $0x0
  pushl $142
80106ccb:	68 8e 00 00 00       	push   $0x8e
  jmp alltraps
80106cd0:	e9 b2 f7 ff ff       	jmp    80106487 <alltraps>

80106cd5 <vector143>:
.globl vector143
vector143:
  pushl $0
80106cd5:	6a 00                	push   $0x0
  pushl $143
80106cd7:	68 8f 00 00 00       	push   $0x8f
  jmp alltraps
80106cdc:	e9 a6 f7 ff ff       	jmp    80106487 <alltraps>

80106ce1 <vector144>:
.globl vector144
vector144:
  pushl $0
80106ce1:	6a 00                	push   $0x0
  pushl $144
80106ce3:	68 90 00 00 00       	push   $0x90
  jmp alltraps
80106ce8:	e9 9a f7 ff ff       	jmp    80106487 <alltraps>

80106ced <vector145>:
.globl vector145
vector145:
  pushl $0
80106ced:	6a 00                	push   $0x0
  pushl $145
80106cef:	68 91 00 00 00       	push   $0x91
  jmp alltraps
80106cf4:	e9 8e f7 ff ff       	jmp    80106487 <alltraps>

80106cf9 <vector146>:
.globl vector146
vector146:
  pushl $0
80106cf9:	6a 00                	push   $0x0
  pushl $146
80106cfb:	68 92 00 00 00       	push   $0x92
  jmp alltraps
80106d00:	e9 82 f7 ff ff       	jmp    80106487 <alltraps>

80106d05 <vector147>:
.globl vector147
vector147:
  pushl $0
80106d05:	6a 00                	push   $0x0
  pushl $147
80106d07:	68 93 00 00 00       	push   $0x93
  jmp alltraps
80106d0c:	e9 76 f7 ff ff       	jmp    80106487 <alltraps>

80106d11 <vector148>:
.globl vector148
vector148:
  pushl $0
80106d11:	6a 00                	push   $0x0
  pushl $148
80106d13:	68 94 00 00 00       	push   $0x94
  jmp alltraps
80106d18:	e9 6a f7 ff ff       	jmp    80106487 <alltraps>

80106d1d <vector149>:
.globl vector149
vector149:
  pushl $0
80106d1d:	6a 00                	push   $0x0
  pushl $149
80106d1f:	68 95 00 00 00       	push   $0x95
  jmp alltraps
80106d24:	e9 5e f7 ff ff       	jmp    80106487 <alltraps>

80106d29 <vector150>:
.globl vector150
vector150:
  pushl $0
80106d29:	6a 00                	push   $0x0
  pushl $150
80106d2b:	68 96 00 00 00       	push   $0x96
  jmp alltraps
80106d30:	e9 52 f7 ff ff       	jmp    80106487 <alltraps>

80106d35 <vector151>:
.globl vector151
vector151:
  pushl $0
80106d35:	6a 00                	push   $0x0
  pushl $151
80106d37:	68 97 00 00 00       	push   $0x97
  jmp alltraps
80106d3c:	e9 46 f7 ff ff       	jmp    80106487 <alltraps>

80106d41 <vector152>:
.globl vector152
vector152:
  pushl $0
80106d41:	6a 00                	push   $0x0
  pushl $152
80106d43:	68 98 00 00 00       	push   $0x98
  jmp alltraps
80106d48:	e9 3a f7 ff ff       	jmp    80106487 <alltraps>

80106d4d <vector153>:
.globl vector153
vector153:
  pushl $0
80106d4d:	6a 00                	push   $0x0
  pushl $153
80106d4f:	68 99 00 00 00       	push   $0x99
  jmp alltraps
80106d54:	e9 2e f7 ff ff       	jmp    80106487 <alltraps>

80106d59 <vector154>:
.globl vector154
vector154:
  pushl $0
80106d59:	6a 00                	push   $0x0
  pushl $154
80106d5b:	68 9a 00 00 00       	push   $0x9a
  jmp alltraps
80106d60:	e9 22 f7 ff ff       	jmp    80106487 <alltraps>

80106d65 <vector155>:
.globl vector155
vector155:
  pushl $0
80106d65:	6a 00                	push   $0x0
  pushl $155
80106d67:	68 9b 00 00 00       	push   $0x9b
  jmp alltraps
80106d6c:	e9 16 f7 ff ff       	jmp    80106487 <alltraps>

80106d71 <vector156>:
.globl vector156
vector156:
  pushl $0
80106d71:	6a 00                	push   $0x0
  pushl $156
80106d73:	68 9c 00 00 00       	push   $0x9c
  jmp alltraps
80106d78:	e9 0a f7 ff ff       	jmp    80106487 <alltraps>

80106d7d <vector157>:
.globl vector157
vector157:
  pushl $0
80106d7d:	6a 00                	push   $0x0
  pushl $157
80106d7f:	68 9d 00 00 00       	push   $0x9d
  jmp alltraps
80106d84:	e9 fe f6 ff ff       	jmp    80106487 <alltraps>

80106d89 <vector158>:
.globl vector158
vector158:
  pushl $0
80106d89:	6a 00                	push   $0x0
  pushl $158
80106d8b:	68 9e 00 00 00       	push   $0x9e
  jmp alltraps
80106d90:	e9 f2 f6 ff ff       	jmp    80106487 <alltraps>

80106d95 <vector159>:
.globl vector159
vector159:
  pushl $0
80106d95:	6a 00                	push   $0x0
  pushl $159
80106d97:	68 9f 00 00 00       	push   $0x9f
  jmp alltraps
80106d9c:	e9 e6 f6 ff ff       	jmp    80106487 <alltraps>

80106da1 <vector160>:
.globl vector160
vector160:
  pushl $0
80106da1:	6a 00                	push   $0x0
  pushl $160
80106da3:	68 a0 00 00 00       	push   $0xa0
  jmp alltraps
80106da8:	e9 da f6 ff ff       	jmp    80106487 <alltraps>

80106dad <vector161>:
.globl vector161
vector161:
  pushl $0
80106dad:	6a 00                	push   $0x0
  pushl $161
80106daf:	68 a1 00 00 00       	push   $0xa1
  jmp alltraps
80106db4:	e9 ce f6 ff ff       	jmp    80106487 <alltraps>

80106db9 <vector162>:
.globl vector162
vector162:
  pushl $0
80106db9:	6a 00                	push   $0x0
  pushl $162
80106dbb:	68 a2 00 00 00       	push   $0xa2
  jmp alltraps
80106dc0:	e9 c2 f6 ff ff       	jmp    80106487 <alltraps>

80106dc5 <vector163>:
.globl vector163
vector163:
  pushl $0
80106dc5:	6a 00                	push   $0x0
  pushl $163
80106dc7:	68 a3 00 00 00       	push   $0xa3
  jmp alltraps
80106dcc:	e9 b6 f6 ff ff       	jmp    80106487 <alltraps>

80106dd1 <vector164>:
.globl vector164
vector164:
  pushl $0
80106dd1:	6a 00                	push   $0x0
  pushl $164
80106dd3:	68 a4 00 00 00       	push   $0xa4
  jmp alltraps
80106dd8:	e9 aa f6 ff ff       	jmp    80106487 <alltraps>

80106ddd <vector165>:
.globl vector165
vector165:
  pushl $0
80106ddd:	6a 00                	push   $0x0
  pushl $165
80106ddf:	68 a5 00 00 00       	push   $0xa5
  jmp alltraps
80106de4:	e9 9e f6 ff ff       	jmp    80106487 <alltraps>

80106de9 <vector166>:
.globl vector166
vector166:
  pushl $0
80106de9:	6a 00                	push   $0x0
  pushl $166
80106deb:	68 a6 00 00 00       	push   $0xa6
  jmp alltraps
80106df0:	e9 92 f6 ff ff       	jmp    80106487 <alltraps>

80106df5 <vector167>:
.globl vector167
vector167:
  pushl $0
80106df5:	6a 00                	push   $0x0
  pushl $167
80106df7:	68 a7 00 00 00       	push   $0xa7
  jmp alltraps
80106dfc:	e9 86 f6 ff ff       	jmp    80106487 <alltraps>

80106e01 <vector168>:
.globl vector168
vector168:
  pushl $0
80106e01:	6a 00                	push   $0x0
  pushl $168
80106e03:	68 a8 00 00 00       	push   $0xa8
  jmp alltraps
80106e08:	e9 7a f6 ff ff       	jmp    80106487 <alltraps>

80106e0d <vector169>:
.globl vector169
vector169:
  pushl $0
80106e0d:	6a 00                	push   $0x0
  pushl $169
80106e0f:	68 a9 00 00 00       	push   $0xa9
  jmp alltraps
80106e14:	e9 6e f6 ff ff       	jmp    80106487 <alltraps>

80106e19 <vector170>:
.globl vector170
vector170:
  pushl $0
80106e19:	6a 00                	push   $0x0
  pushl $170
80106e1b:	68 aa 00 00 00       	push   $0xaa
  jmp alltraps
80106e20:	e9 62 f6 ff ff       	jmp    80106487 <alltraps>

80106e25 <vector171>:
.globl vector171
vector171:
  pushl $0
80106e25:	6a 00                	push   $0x0
  pushl $171
80106e27:	68 ab 00 00 00       	push   $0xab
  jmp alltraps
80106e2c:	e9 56 f6 ff ff       	jmp    80106487 <alltraps>

80106e31 <vector172>:
.globl vector172
vector172:
  pushl $0
80106e31:	6a 00                	push   $0x0
  pushl $172
80106e33:	68 ac 00 00 00       	push   $0xac
  jmp alltraps
80106e38:	e9 4a f6 ff ff       	jmp    80106487 <alltraps>

80106e3d <vector173>:
.globl vector173
vector173:
  pushl $0
80106e3d:	6a 00                	push   $0x0
  pushl $173
80106e3f:	68 ad 00 00 00       	push   $0xad
  jmp alltraps
80106e44:	e9 3e f6 ff ff       	jmp    80106487 <alltraps>

80106e49 <vector174>:
.globl vector174
vector174:
  pushl $0
80106e49:	6a 00                	push   $0x0
  pushl $174
80106e4b:	68 ae 00 00 00       	push   $0xae
  jmp alltraps
80106e50:	e9 32 f6 ff ff       	jmp    80106487 <alltraps>

80106e55 <vector175>:
.globl vector175
vector175:
  pushl $0
80106e55:	6a 00                	push   $0x0
  pushl $175
80106e57:	68 af 00 00 00       	push   $0xaf
  jmp alltraps
80106e5c:	e9 26 f6 ff ff       	jmp    80106487 <alltraps>

80106e61 <vector176>:
.globl vector176
vector176:
  pushl $0
80106e61:	6a 00                	push   $0x0
  pushl $176
80106e63:	68 b0 00 00 00       	push   $0xb0
  jmp alltraps
80106e68:	e9 1a f6 ff ff       	jmp    80106487 <alltraps>

80106e6d <vector177>:
.globl vector177
vector177:
  pushl $0
80106e6d:	6a 00                	push   $0x0
  pushl $177
80106e6f:	68 b1 00 00 00       	push   $0xb1
  jmp alltraps
80106e74:	e9 0e f6 ff ff       	jmp    80106487 <alltraps>

80106e79 <vector178>:
.globl vector178
vector178:
  pushl $0
80106e79:	6a 00                	push   $0x0
  pushl $178
80106e7b:	68 b2 00 00 00       	push   $0xb2
  jmp alltraps
80106e80:	e9 02 f6 ff ff       	jmp    80106487 <alltraps>

80106e85 <vector179>:
.globl vector179
vector179:
  pushl $0
80106e85:	6a 00                	push   $0x0
  pushl $179
80106e87:	68 b3 00 00 00       	push   $0xb3
  jmp alltraps
80106e8c:	e9 f6 f5 ff ff       	jmp    80106487 <alltraps>

80106e91 <vector180>:
.globl vector180
vector180:
  pushl $0
80106e91:	6a 00                	push   $0x0
  pushl $180
80106e93:	68 b4 00 00 00       	push   $0xb4
  jmp alltraps
80106e98:	e9 ea f5 ff ff       	jmp    80106487 <alltraps>

80106e9d <vector181>:
.globl vector181
vector181:
  pushl $0
80106e9d:	6a 00                	push   $0x0
  pushl $181
80106e9f:	68 b5 00 00 00       	push   $0xb5
  jmp alltraps
80106ea4:	e9 de f5 ff ff       	jmp    80106487 <alltraps>

80106ea9 <vector182>:
.globl vector182
vector182:
  pushl $0
80106ea9:	6a 00                	push   $0x0
  pushl $182
80106eab:	68 b6 00 00 00       	push   $0xb6
  jmp alltraps
80106eb0:	e9 d2 f5 ff ff       	jmp    80106487 <alltraps>

80106eb5 <vector183>:
.globl vector183
vector183:
  pushl $0
80106eb5:	6a 00                	push   $0x0
  pushl $183
80106eb7:	68 b7 00 00 00       	push   $0xb7
  jmp alltraps
80106ebc:	e9 c6 f5 ff ff       	jmp    80106487 <alltraps>

80106ec1 <vector184>:
.globl vector184
vector184:
  pushl $0
80106ec1:	6a 00                	push   $0x0
  pushl $184
80106ec3:	68 b8 00 00 00       	push   $0xb8
  jmp alltraps
80106ec8:	e9 ba f5 ff ff       	jmp    80106487 <alltraps>

80106ecd <vector185>:
.globl vector185
vector185:
  pushl $0
80106ecd:	6a 00                	push   $0x0
  pushl $185
80106ecf:	68 b9 00 00 00       	push   $0xb9
  jmp alltraps
80106ed4:	e9 ae f5 ff ff       	jmp    80106487 <alltraps>

80106ed9 <vector186>:
.globl vector186
vector186:
  pushl $0
80106ed9:	6a 00                	push   $0x0
  pushl $186
80106edb:	68 ba 00 00 00       	push   $0xba
  jmp alltraps
80106ee0:	e9 a2 f5 ff ff       	jmp    80106487 <alltraps>

80106ee5 <vector187>:
.globl vector187
vector187:
  pushl $0
80106ee5:	6a 00                	push   $0x0
  pushl $187
80106ee7:	68 bb 00 00 00       	push   $0xbb
  jmp alltraps
80106eec:	e9 96 f5 ff ff       	jmp    80106487 <alltraps>

80106ef1 <vector188>:
.globl vector188
vector188:
  pushl $0
80106ef1:	6a 00                	push   $0x0
  pushl $188
80106ef3:	68 bc 00 00 00       	push   $0xbc
  jmp alltraps
80106ef8:	e9 8a f5 ff ff       	jmp    80106487 <alltraps>

80106efd <vector189>:
.globl vector189
vector189:
  pushl $0
80106efd:	6a 00                	push   $0x0
  pushl $189
80106eff:	68 bd 00 00 00       	push   $0xbd
  jmp alltraps
80106f04:	e9 7e f5 ff ff       	jmp    80106487 <alltraps>

80106f09 <vector190>:
.globl vector190
vector190:
  pushl $0
80106f09:	6a 00                	push   $0x0
  pushl $190
80106f0b:	68 be 00 00 00       	push   $0xbe
  jmp alltraps
80106f10:	e9 72 f5 ff ff       	jmp    80106487 <alltraps>

80106f15 <vector191>:
.globl vector191
vector191:
  pushl $0
80106f15:	6a 00                	push   $0x0
  pushl $191
80106f17:	68 bf 00 00 00       	push   $0xbf
  jmp alltraps
80106f1c:	e9 66 f5 ff ff       	jmp    80106487 <alltraps>

80106f21 <vector192>:
.globl vector192
vector192:
  pushl $0
80106f21:	6a 00                	push   $0x0
  pushl $192
80106f23:	68 c0 00 00 00       	push   $0xc0
  jmp alltraps
80106f28:	e9 5a f5 ff ff       	jmp    80106487 <alltraps>

80106f2d <vector193>:
.globl vector193
vector193:
  pushl $0
80106f2d:	6a 00                	push   $0x0
  pushl $193
80106f2f:	68 c1 00 00 00       	push   $0xc1
  jmp alltraps
80106f34:	e9 4e f5 ff ff       	jmp    80106487 <alltraps>

80106f39 <vector194>:
.globl vector194
vector194:
  pushl $0
80106f39:	6a 00                	push   $0x0
  pushl $194
80106f3b:	68 c2 00 00 00       	push   $0xc2
  jmp alltraps
80106f40:	e9 42 f5 ff ff       	jmp    80106487 <alltraps>

80106f45 <vector195>:
.globl vector195
vector195:
  pushl $0
80106f45:	6a 00                	push   $0x0
  pushl $195
80106f47:	68 c3 00 00 00       	push   $0xc3
  jmp alltraps
80106f4c:	e9 36 f5 ff ff       	jmp    80106487 <alltraps>

80106f51 <vector196>:
.globl vector196
vector196:
  pushl $0
80106f51:	6a 00                	push   $0x0
  pushl $196
80106f53:	68 c4 00 00 00       	push   $0xc4
  jmp alltraps
80106f58:	e9 2a f5 ff ff       	jmp    80106487 <alltraps>

80106f5d <vector197>:
.globl vector197
vector197:
  pushl $0
80106f5d:	6a 00                	push   $0x0
  pushl $197
80106f5f:	68 c5 00 00 00       	push   $0xc5
  jmp alltraps
80106f64:	e9 1e f5 ff ff       	jmp    80106487 <alltraps>

80106f69 <vector198>:
.globl vector198
vector198:
  pushl $0
80106f69:	6a 00                	push   $0x0
  pushl $198
80106f6b:	68 c6 00 00 00       	push   $0xc6
  jmp alltraps
80106f70:	e9 12 f5 ff ff       	jmp    80106487 <alltraps>

80106f75 <vector199>:
.globl vector199
vector199:
  pushl $0
80106f75:	6a 00                	push   $0x0
  pushl $199
80106f77:	68 c7 00 00 00       	push   $0xc7
  jmp alltraps
80106f7c:	e9 06 f5 ff ff       	jmp    80106487 <alltraps>

80106f81 <vector200>:
.globl vector200
vector200:
  pushl $0
80106f81:	6a 00                	push   $0x0
  pushl $200
80106f83:	68 c8 00 00 00       	push   $0xc8
  jmp alltraps
80106f88:	e9 fa f4 ff ff       	jmp    80106487 <alltraps>

80106f8d <vector201>:
.globl vector201
vector201:
  pushl $0
80106f8d:	6a 00                	push   $0x0
  pushl $201
80106f8f:	68 c9 00 00 00       	push   $0xc9
  jmp alltraps
80106f94:	e9 ee f4 ff ff       	jmp    80106487 <alltraps>

80106f99 <vector202>:
.globl vector202
vector202:
  pushl $0
80106f99:	6a 00                	push   $0x0
  pushl $202
80106f9b:	68 ca 00 00 00       	push   $0xca
  jmp alltraps
80106fa0:	e9 e2 f4 ff ff       	jmp    80106487 <alltraps>

80106fa5 <vector203>:
.globl vector203
vector203:
  pushl $0
80106fa5:	6a 00                	push   $0x0
  pushl $203
80106fa7:	68 cb 00 00 00       	push   $0xcb
  jmp alltraps
80106fac:	e9 d6 f4 ff ff       	jmp    80106487 <alltraps>

80106fb1 <vector204>:
.globl vector204
vector204:
  pushl $0
80106fb1:	6a 00                	push   $0x0
  pushl $204
80106fb3:	68 cc 00 00 00       	push   $0xcc
  jmp alltraps
80106fb8:	e9 ca f4 ff ff       	jmp    80106487 <alltraps>

80106fbd <vector205>:
.globl vector205
vector205:
  pushl $0
80106fbd:	6a 00                	push   $0x0
  pushl $205
80106fbf:	68 cd 00 00 00       	push   $0xcd
  jmp alltraps
80106fc4:	e9 be f4 ff ff       	jmp    80106487 <alltraps>

80106fc9 <vector206>:
.globl vector206
vector206:
  pushl $0
80106fc9:	6a 00                	push   $0x0
  pushl $206
80106fcb:	68 ce 00 00 00       	push   $0xce
  jmp alltraps
80106fd0:	e9 b2 f4 ff ff       	jmp    80106487 <alltraps>

80106fd5 <vector207>:
.globl vector207
vector207:
  pushl $0
80106fd5:	6a 00                	push   $0x0
  pushl $207
80106fd7:	68 cf 00 00 00       	push   $0xcf
  jmp alltraps
80106fdc:	e9 a6 f4 ff ff       	jmp    80106487 <alltraps>

80106fe1 <vector208>:
.globl vector208
vector208:
  pushl $0
80106fe1:	6a 00                	push   $0x0
  pushl $208
80106fe3:	68 d0 00 00 00       	push   $0xd0
  jmp alltraps
80106fe8:	e9 9a f4 ff ff       	jmp    80106487 <alltraps>

80106fed <vector209>:
.globl vector209
vector209:
  pushl $0
80106fed:	6a 00                	push   $0x0
  pushl $209
80106fef:	68 d1 00 00 00       	push   $0xd1
  jmp alltraps
80106ff4:	e9 8e f4 ff ff       	jmp    80106487 <alltraps>

80106ff9 <vector210>:
.globl vector210
vector210:
  pushl $0
80106ff9:	6a 00                	push   $0x0
  pushl $210
80106ffb:	68 d2 00 00 00       	push   $0xd2
  jmp alltraps
80107000:	e9 82 f4 ff ff       	jmp    80106487 <alltraps>

80107005 <vector211>:
.globl vector211
vector211:
  pushl $0
80107005:	6a 00                	push   $0x0
  pushl $211
80107007:	68 d3 00 00 00       	push   $0xd3
  jmp alltraps
8010700c:	e9 76 f4 ff ff       	jmp    80106487 <alltraps>

80107011 <vector212>:
.globl vector212
vector212:
  pushl $0
80107011:	6a 00                	push   $0x0
  pushl $212
80107013:	68 d4 00 00 00       	push   $0xd4
  jmp alltraps
80107018:	e9 6a f4 ff ff       	jmp    80106487 <alltraps>

8010701d <vector213>:
.globl vector213
vector213:
  pushl $0
8010701d:	6a 00                	push   $0x0
  pushl $213
8010701f:	68 d5 00 00 00       	push   $0xd5
  jmp alltraps
80107024:	e9 5e f4 ff ff       	jmp    80106487 <alltraps>

80107029 <vector214>:
.globl vector214
vector214:
  pushl $0
80107029:	6a 00                	push   $0x0
  pushl $214
8010702b:	68 d6 00 00 00       	push   $0xd6
  jmp alltraps
80107030:	e9 52 f4 ff ff       	jmp    80106487 <alltraps>

80107035 <vector215>:
.globl vector215
vector215:
  pushl $0
80107035:	6a 00                	push   $0x0
  pushl $215
80107037:	68 d7 00 00 00       	push   $0xd7
  jmp alltraps
8010703c:	e9 46 f4 ff ff       	jmp    80106487 <alltraps>

80107041 <vector216>:
.globl vector216
vector216:
  pushl $0
80107041:	6a 00                	push   $0x0
  pushl $216
80107043:	68 d8 00 00 00       	push   $0xd8
  jmp alltraps
80107048:	e9 3a f4 ff ff       	jmp    80106487 <alltraps>

8010704d <vector217>:
.globl vector217
vector217:
  pushl $0
8010704d:	6a 00                	push   $0x0
  pushl $217
8010704f:	68 d9 00 00 00       	push   $0xd9
  jmp alltraps
80107054:	e9 2e f4 ff ff       	jmp    80106487 <alltraps>

80107059 <vector218>:
.globl vector218
vector218:
  pushl $0
80107059:	6a 00                	push   $0x0
  pushl $218
8010705b:	68 da 00 00 00       	push   $0xda
  jmp alltraps
80107060:	e9 22 f4 ff ff       	jmp    80106487 <alltraps>

80107065 <vector219>:
.globl vector219
vector219:
  pushl $0
80107065:	6a 00                	push   $0x0
  pushl $219
80107067:	68 db 00 00 00       	push   $0xdb
  jmp alltraps
8010706c:	e9 16 f4 ff ff       	jmp    80106487 <alltraps>

80107071 <vector220>:
.globl vector220
vector220:
  pushl $0
80107071:	6a 00                	push   $0x0
  pushl $220
80107073:	68 dc 00 00 00       	push   $0xdc
  jmp alltraps
80107078:	e9 0a f4 ff ff       	jmp    80106487 <alltraps>

8010707d <vector221>:
.globl vector221
vector221:
  pushl $0
8010707d:	6a 00                	push   $0x0
  pushl $221
8010707f:	68 dd 00 00 00       	push   $0xdd
  jmp alltraps
80107084:	e9 fe f3 ff ff       	jmp    80106487 <alltraps>

80107089 <vector222>:
.globl vector222
vector222:
  pushl $0
80107089:	6a 00                	push   $0x0
  pushl $222
8010708b:	68 de 00 00 00       	push   $0xde
  jmp alltraps
80107090:	e9 f2 f3 ff ff       	jmp    80106487 <alltraps>

80107095 <vector223>:
.globl vector223
vector223:
  pushl $0
80107095:	6a 00                	push   $0x0
  pushl $223
80107097:	68 df 00 00 00       	push   $0xdf
  jmp alltraps
8010709c:	e9 e6 f3 ff ff       	jmp    80106487 <alltraps>

801070a1 <vector224>:
.globl vector224
vector224:
  pushl $0
801070a1:	6a 00                	push   $0x0
  pushl $224
801070a3:	68 e0 00 00 00       	push   $0xe0
  jmp alltraps
801070a8:	e9 da f3 ff ff       	jmp    80106487 <alltraps>

801070ad <vector225>:
.globl vector225
vector225:
  pushl $0
801070ad:	6a 00                	push   $0x0
  pushl $225
801070af:	68 e1 00 00 00       	push   $0xe1
  jmp alltraps
801070b4:	e9 ce f3 ff ff       	jmp    80106487 <alltraps>

801070b9 <vector226>:
.globl vector226
vector226:
  pushl $0
801070b9:	6a 00                	push   $0x0
  pushl $226
801070bb:	68 e2 00 00 00       	push   $0xe2
  jmp alltraps
801070c0:	e9 c2 f3 ff ff       	jmp    80106487 <alltraps>

801070c5 <vector227>:
.globl vector227
vector227:
  pushl $0
801070c5:	6a 00                	push   $0x0
  pushl $227
801070c7:	68 e3 00 00 00       	push   $0xe3
  jmp alltraps
801070cc:	e9 b6 f3 ff ff       	jmp    80106487 <alltraps>

801070d1 <vector228>:
.globl vector228
vector228:
  pushl $0
801070d1:	6a 00                	push   $0x0
  pushl $228
801070d3:	68 e4 00 00 00       	push   $0xe4
  jmp alltraps
801070d8:	e9 aa f3 ff ff       	jmp    80106487 <alltraps>

801070dd <vector229>:
.globl vector229
vector229:
  pushl $0
801070dd:	6a 00                	push   $0x0
  pushl $229
801070df:	68 e5 00 00 00       	push   $0xe5
  jmp alltraps
801070e4:	e9 9e f3 ff ff       	jmp    80106487 <alltraps>

801070e9 <vector230>:
.globl vector230
vector230:
  pushl $0
801070e9:	6a 00                	push   $0x0
  pushl $230
801070eb:	68 e6 00 00 00       	push   $0xe6
  jmp alltraps
801070f0:	e9 92 f3 ff ff       	jmp    80106487 <alltraps>

801070f5 <vector231>:
.globl vector231
vector231:
  pushl $0
801070f5:	6a 00                	push   $0x0
  pushl $231
801070f7:	68 e7 00 00 00       	push   $0xe7
  jmp alltraps
801070fc:	e9 86 f3 ff ff       	jmp    80106487 <alltraps>

80107101 <vector232>:
.globl vector232
vector232:
  pushl $0
80107101:	6a 00                	push   $0x0
  pushl $232
80107103:	68 e8 00 00 00       	push   $0xe8
  jmp alltraps
80107108:	e9 7a f3 ff ff       	jmp    80106487 <alltraps>

8010710d <vector233>:
.globl vector233
vector233:
  pushl $0
8010710d:	6a 00                	push   $0x0
  pushl $233
8010710f:	68 e9 00 00 00       	push   $0xe9
  jmp alltraps
80107114:	e9 6e f3 ff ff       	jmp    80106487 <alltraps>

80107119 <vector234>:
.globl vector234
vector234:
  pushl $0
80107119:	6a 00                	push   $0x0
  pushl $234
8010711b:	68 ea 00 00 00       	push   $0xea
  jmp alltraps
80107120:	e9 62 f3 ff ff       	jmp    80106487 <alltraps>

80107125 <vector235>:
.globl vector235
vector235:
  pushl $0
80107125:	6a 00                	push   $0x0
  pushl $235
80107127:	68 eb 00 00 00       	push   $0xeb
  jmp alltraps
8010712c:	e9 56 f3 ff ff       	jmp    80106487 <alltraps>

80107131 <vector236>:
.globl vector236
vector236:
  pushl $0
80107131:	6a 00                	push   $0x0
  pushl $236
80107133:	68 ec 00 00 00       	push   $0xec
  jmp alltraps
80107138:	e9 4a f3 ff ff       	jmp    80106487 <alltraps>

8010713d <vector237>:
.globl vector237
vector237:
  pushl $0
8010713d:	6a 00                	push   $0x0
  pushl $237
8010713f:	68 ed 00 00 00       	push   $0xed
  jmp alltraps
80107144:	e9 3e f3 ff ff       	jmp    80106487 <alltraps>

80107149 <vector238>:
.globl vector238
vector238:
  pushl $0
80107149:	6a 00                	push   $0x0
  pushl $238
8010714b:	68 ee 00 00 00       	push   $0xee
  jmp alltraps
80107150:	e9 32 f3 ff ff       	jmp    80106487 <alltraps>

80107155 <vector239>:
.globl vector239
vector239:
  pushl $0
80107155:	6a 00                	push   $0x0
  pushl $239
80107157:	68 ef 00 00 00       	push   $0xef
  jmp alltraps
8010715c:	e9 26 f3 ff ff       	jmp    80106487 <alltraps>

80107161 <vector240>:
.globl vector240
vector240:
  pushl $0
80107161:	6a 00                	push   $0x0
  pushl $240
80107163:	68 f0 00 00 00       	push   $0xf0
  jmp alltraps
80107168:	e9 1a f3 ff ff       	jmp    80106487 <alltraps>

8010716d <vector241>:
.globl vector241
vector241:
  pushl $0
8010716d:	6a 00                	push   $0x0
  pushl $241
8010716f:	68 f1 00 00 00       	push   $0xf1
  jmp alltraps
80107174:	e9 0e f3 ff ff       	jmp    80106487 <alltraps>

80107179 <vector242>:
.globl vector242
vector242:
  pushl $0
80107179:	6a 00                	push   $0x0
  pushl $242
8010717b:	68 f2 00 00 00       	push   $0xf2
  jmp alltraps
80107180:	e9 02 f3 ff ff       	jmp    80106487 <alltraps>

80107185 <vector243>:
.globl vector243
vector243:
  pushl $0
80107185:	6a 00                	push   $0x0
  pushl $243
80107187:	68 f3 00 00 00       	push   $0xf3
  jmp alltraps
8010718c:	e9 f6 f2 ff ff       	jmp    80106487 <alltraps>

80107191 <vector244>:
.globl vector244
vector244:
  pushl $0
80107191:	6a 00                	push   $0x0
  pushl $244
80107193:	68 f4 00 00 00       	push   $0xf4
  jmp alltraps
80107198:	e9 ea f2 ff ff       	jmp    80106487 <alltraps>

8010719d <vector245>:
.globl vector245
vector245:
  pushl $0
8010719d:	6a 00                	push   $0x0
  pushl $245
8010719f:	68 f5 00 00 00       	push   $0xf5
  jmp alltraps
801071a4:	e9 de f2 ff ff       	jmp    80106487 <alltraps>

801071a9 <vector246>:
.globl vector246
vector246:
  pushl $0
801071a9:	6a 00                	push   $0x0
  pushl $246
801071ab:	68 f6 00 00 00       	push   $0xf6
  jmp alltraps
801071b0:	e9 d2 f2 ff ff       	jmp    80106487 <alltraps>

801071b5 <vector247>:
.globl vector247
vector247:
  pushl $0
801071b5:	6a 00                	push   $0x0
  pushl $247
801071b7:	68 f7 00 00 00       	push   $0xf7
  jmp alltraps
801071bc:	e9 c6 f2 ff ff       	jmp    80106487 <alltraps>

801071c1 <vector248>:
.globl vector248
vector248:
  pushl $0
801071c1:	6a 00                	push   $0x0
  pushl $248
801071c3:	68 f8 00 00 00       	push   $0xf8
  jmp alltraps
801071c8:	e9 ba f2 ff ff       	jmp    80106487 <alltraps>

801071cd <vector249>:
.globl vector249
vector249:
  pushl $0
801071cd:	6a 00                	push   $0x0
  pushl $249
801071cf:	68 f9 00 00 00       	push   $0xf9
  jmp alltraps
801071d4:	e9 ae f2 ff ff       	jmp    80106487 <alltraps>

801071d9 <vector250>:
.globl vector250
vector250:
  pushl $0
801071d9:	6a 00                	push   $0x0
  pushl $250
801071db:	68 fa 00 00 00       	push   $0xfa
  jmp alltraps
801071e0:	e9 a2 f2 ff ff       	jmp    80106487 <alltraps>

801071e5 <vector251>:
.globl vector251
vector251:
  pushl $0
801071e5:	6a 00                	push   $0x0
  pushl $251
801071e7:	68 fb 00 00 00       	push   $0xfb
  jmp alltraps
801071ec:	e9 96 f2 ff ff       	jmp    80106487 <alltraps>

801071f1 <vector252>:
.globl vector252
vector252:
  pushl $0
801071f1:	6a 00                	push   $0x0
  pushl $252
801071f3:	68 fc 00 00 00       	push   $0xfc
  jmp alltraps
801071f8:	e9 8a f2 ff ff       	jmp    80106487 <alltraps>

801071fd <vector253>:
.globl vector253
vector253:
  pushl $0
801071fd:	6a 00                	push   $0x0
  pushl $253
801071ff:	68 fd 00 00 00       	push   $0xfd
  jmp alltraps
80107204:	e9 7e f2 ff ff       	jmp    80106487 <alltraps>

80107209 <vector254>:
.globl vector254
vector254:
  pushl $0
80107209:	6a 00                	push   $0x0
  pushl $254
8010720b:	68 fe 00 00 00       	push   $0xfe
  jmp alltraps
80107210:	e9 72 f2 ff ff       	jmp    80106487 <alltraps>

80107215 <vector255>:
.globl vector255
vector255:
  pushl $0
80107215:	6a 00                	push   $0x0
  pushl $255
80107217:	68 ff 00 00 00       	push   $0xff
  jmp alltraps
8010721c:	e9 66 f2 ff ff       	jmp    80106487 <alltraps>
